IntelliJ IDEA. Writing Tests with JUnit 5

Поделиться
HTML-код
  • Опубликовано: 18 дек 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]

  • @khaledabdulazim
    @khaledabdulazim 4 года назад +2

    Nice tutorial. Thanks, Trisha!

  • @yusufaslan5772
    @yusufaslan5772 3 года назад +1

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

  • @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 :)

  • @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к 3 года назад +1

      @@anthonroythomas8326 thanks

  • @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

  • @hubert1224
    @hubert1224 4 года назад +2

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

    • @RodrigoBalest
      @RodrigoBalest 3 года назад

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

  • @nanashipersonne4151
    @nanashipersonne4151 2 года назад +1

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

  • @vinodkumar-ob6hl
    @vinodkumar-ob6hl 3 года назад

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

  • @GuitarreroDaniel
    @GuitarreroDaniel 4 года назад +1

    Very useful, thank you very much!

  • @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?

  • @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.

  • @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 ruclips.net/video/ffBeoE6NBSs/видео.html

  • @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?

  • @倪明-t8i
    @倪明-t8i 4 года назад +1

    Nice

  • @mostafaismail5256
    @mostafaismail5256 3 года назад +1

    very helpful, thank you

  • @azenkwed
    @azenkwed 3 года назад

    Link to the wrong blog in the description.

  • @kanaillaurent526
    @kanaillaurent526 4 года назад

    Intellij rocks!

  • @michaelarson9616
    @michaelarson9616 4 года назад +1

    Thanks ibm we are all bee ai dev

  • @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 2 года назад

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

  • @codingr2863
    @codingr2863 4 года назад

    Good job ! LOL

  • @michaelarson9616
    @michaelarson9616 4 года назад +1

    Developer.visa.com and mit.edu and ibm

  • @PabloQ90
    @PabloQ90 2 года назад +1

    The worst IDE for testing