IntelliJ IDEA. Writing Tests with JUnit 5

Поділитися
Вставка
  • Опубліковано 2 лис 2024

КОМЕНТАРІ • 44

  • @is-gr8775
    @is-gr8775 3 роки тому +8

    Nice tutorial as always :)
    The assertAll method shown at 10:26 is useful indeed. However in this specific case I would prefer using AssertJ as a library.
    The test statement then becomes:
    assertThat(numbers).isEqualTo(List.of(2, 5, 3, 7));
    The output would be:
    Expected :[2, 5, 3, 7]
    Actual :[2, 3, 5, 7]

  • @mailsiraj
    @mailsiraj Рік тому

    Very thorough coverage of Junit 5 - I am new to IDEA and learnt a lot of features of IDEA in writing tests faster - I loved the live template which takes the display name and spares me from writing long method names with camelcase. Thank you so much...Given that the new UI looks completely different from what you are showing, may be it is time for you to redo this video :)

  • @yusufaslan5772
    @yusufaslan5772 3 роки тому +1

    this is very useful for setting up automation framework. thank you intellij team

  • @songzhang4010
    @songzhang4010 3 роки тому +3

    Love your British accent.

  • @ארזעמיהוד
    @ארזעמיהוד 2 роки тому

    This is a really good video. The only bummer is that when talking you could say something about the keyboard shortcuts (even at the end of the video) and the code written, for people who prefer to listen rather then see and to allow people who like to see to follow along more easily.
    Beside that, really nice video. Clear voice and good explanations abd consentration on what is important for this video

  • @khaledabdulazim
    @khaledabdulazim 4 роки тому +2

    Nice tutorial. Thanks, Trisha!

  • @hubert1224
    @hubert1224 3 роки тому +2

    I really like the @ALBERT BOGONENKO annotation used at 6:06 ( captions :) )

    • @RodrigoBalest
      @RodrigoBalest 2 роки тому

      There's also a @Richard Sun at 14:11 😄

  • @lucaherrmann77
    @lucaherrmann77 3 роки тому +5

    hi, how do I get into the generate-window at 0:28?
    The commands from the clip do open a window in the right in which I cannot add any dependencies.

    • @ramsay9912
      @ramsay9912 3 роки тому

      same here.

    • @anthonroythomas8326
      @anthonroythomas8326 3 роки тому +2

      Hey mate, looks like the typical "Tutorial vs Reality" syndrome here, out of date steps as usual.
      check here for the latest: www.jetbrains.com/help/idea/work-with-gradle-dependency-diagram.html
      But for speed, press ALT+Insert while in the build.gradle window.

    • @lucaherrmann77
      @lucaherrmann77 3 роки тому +4

      Update: I found a very simple solution. Go into your project, hover in your code over the class you want to test and press Alt+Enter on the class name. In the drop down menu that will appear you will find the option "create test". When you click on it, it will select JUnit 5 as testing library and works perfectly. Hope I helped anyone who has the same problem :D

    • @leandroa9581
      @leandroa9581 3 роки тому +1

      Another solution is create a new class in folder test and then press alt+insert -> test method. At least it worked for me

    • @ВиталийПроломов-и2к
      @ВиталийПроломов-и2к 2 роки тому +1

      @@anthonroythomas8326 thanks

  • @GuitarreroDaniel
    @GuitarreroDaniel 3 роки тому +1

    Very useful, thank you very much!

  • @vinodkumar-ob6hl
    @vinodkumar-ob6hl 2 роки тому

    How to run Junit5 @Suite from right click Suite class, for me it says no tests found?

  • @nanashipersonne4151
    @nanashipersonne4151 2 роки тому +1

    CTRL and enter does not work for me to add a dependency.

  • @kanaillaurent526
    @kanaillaurent526 4 роки тому

    Intellij rocks!

  • @bumblebity2902
    @bumblebity2902 3 роки тому

    Sorry, I have issue Process finished with exit code -1 when launching tests. My RDBMS is launched as well. Video doesn't work for me.

  • @倪明-t8i
    @倪明-t8i 3 роки тому +1

    Nice

  • @daniel_goncalves
    @daniel_goncalves Рік тому

    I cant run only one test method. When a hit the green arrow to run the test, intellij runs all the tests of the project. Anyone can help me?

  • @babai5655
    @babai5655 2 роки тому +1

    Good tutorial but examples with Fixture and Shape did not work for me. Shape is an interface - can't create an instance. It would be good to have a clearer example or explain in more details.

    • @babai5655
      @babai5655 2 роки тому +1

      class Shape {
      int numberOfSides;
      Shape(int i) {
      numberOfSides = i;
      }
      int numberOfSides() {
      return numberOfSides;
      }
      }
      @ParameterizedTest
      @DisplayName("Should create shapes with different numbers of sides")
      @ValueSource(ints = {2,3,4,5})
      void shouldCreateShapesWithDifferentNumbersOfSides(int expectedNumberOfSides){
      Shape shape = new Shape(expectedNumberOfSides);
      Assertions.assertEquals(expectedNumberOfSides, shape.numberOfSides());
      is it the right way to make it working?

  • @mostafaismail5256
    @mostafaismail5256 3 роки тому +1

    very helpful, thank you

  • @michaelarson9616
    @michaelarson9616 4 роки тому +1

    Thanks ibm we are all bee ai dev

  • @azenkwed
    @azenkwed 3 роки тому

    Link to the wrong blog in the description.

  • @quintonbarnes68
    @quintonbarnes68 2 роки тому

    can someone explain exactly how to get the @DisplayName string parameter to be the function handle at 7:35 ? The explanation at the bottom of the screen says "Choose Lookup Item Replace via ->|" but I can't figure out what that means nor find any setting similar to 'Choose Lookup Item Replace'

    • @quintonbarnes68
      @quintonbarnes68 2 роки тому +1

      Found the solution in another video for this channel. If anyone else is also looking for this answer they can find it here ua-cam.com/video/ffBeoE6NBSs/v-deo.html

  • @codingr2863
    @codingr2863 4 роки тому

    Good job ! LOL

  • @praveenkumarthimmareddy1499
    @praveenkumarthimmareddy1499 4 роки тому +1

    shouldShowSimpleAssertion method failed when running the test task, to fix the same---> Go the gradle Setting---> use RUN TESTS USING "Intellij IDEA"

  • @shotbyburba
    @shotbyburba Рік тому

    Valuable information, however, very difficult to follow, it's just way too fast and for me, as a beginner, too confuzing.

  • @michaelarson9616
    @michaelarson9616 4 роки тому +1

    Developer.visa.com and mit.edu and ibm

  • @PabloQ90
    @PabloQ90 2 роки тому +1

    The worst IDE for testing