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]
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 :)
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.
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
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
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'
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
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.
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?
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]
Nice tutorial. Thanks, Trisha!
this is very useful for setting up automation framework. thank you intellij team
Glad it was helpful!
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 :)
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.
same here.
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.
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
Another solution is create a new class in folder test and then press alt+insert -> test method. At least it worked for me
@@anthonroythomas8326 thanks
Love your British accent.
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
I really like the @ALBERT BOGONENKO annotation used at 6:06 ( captions :) )
There's also a @Richard Sun at 14:11 😄
CTRL and enter does not work for me to add a dependency.
How to run Junit5 @Suite from right click Suite class, for me it says no tests found?
Very useful, thank you very much!
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?
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.
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'
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
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.
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?
Nice
very helpful, thank you
Glad to hear that!
Link to the wrong blog in the description.
Intellij rocks!
Thanks ibm we are all bee ai dev
shouldShowSimpleAssertion method failed when running the test task, to fix the same---> Go the gradle Setting---> use RUN TESTS USING "Intellij IDEA"
Valuable information, however, very difficult to follow, it's just way too fast and for me, as a beginner, too confuzing.
Good job ! LOL
Developer.visa.com and mit.edu and ibm
The worst IDE for testing