JUnit 5 – assertAll

Main menu:

Topics

Recent Posts

Feeds

RSS Feed RSS - Posts

April 2018
M T W T F S S
« Mar    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Past Posts

Java/Java EE

JDBC

Other

Archive for category JUnit 5

JUnit 5 – assertAll

February 25th, 2018 by Jeanne Boyarsky

I gave a half day JUnit 5 workshop at DevNexus last week. When I covered assertAll(), an interesting piece of code came up. In JUnit 5, there is an assertAll() which runs all of the assertions it contains so you can see all of them that failed at once.  This replaces the need for AssertJ’s SoftAssertions. […]

junit 5, gradle and containers

February 11th, 2018 by Jeanne Boyarsky

Up until recently, I’ve been using JUnit 5 with Eclipse and Maven. As I started using it with Gradle, I became frustrated that you couldn’t see the number of tests run when the tests succeeded. (Don’t worry; this is an easily solvable problem.) First JUnit 4 You can add code to have Groovy print the […]

upgrading mockito – forwards and backwards

September 9th, 2017 by Jeanne Boyarsky

I upgraded Mockito from 1.X to 2.X. (Because I wanted to try out the JUnit 5 MockitoExtension. JUnit 4 I like @RunWith(MockitoJUnitRunner.class). The two main benefits: Inject mocks as instance variables instead of static call to MockitoAnnotations.initMocks(this); Tells you about unnecessary mock setup calls you have. JUnit 5 Instead of the Mockito Runner, you use @ExtendWith(MockitoExtension.class). This was written […]