Junit 5 Asserts Exceptions
A good coding practice is to throw exceptions when data is invalid. A better test case is to check whether, for an invalid argument, the exception is thrown or not. To test both scenarios, JUnit 5 provides us assertThrows and assertDoesNotThrow methods
Default Method in Interface
Up to Java 7, an Interface could only have abstract methods and constants only. implementing class has to implement all the abstract methods of the interface even if that's not required.👍
https://t.co/qYwdXL1idP
#wesome#wesomeorg#Java#Java8
Junit 5 Test Case Parallel Execution
All the test cases written in JUnit 5 run sequentially in a single thread.
we can run the test cases parallelly. JUnit 5 provides us with cases@Execution annotation to run test cases parallelly.
#wesome
https://t.co/7xIxEdUVvO
Junit 5 Pioneer @DefaultTimeZone
JUnit 5 pioneer provides @DefaultTimeZone annotation to temporarily change the timezone value for test execution. Once the test execution completes, its default value will be restored.
#wesome
https://t.co/bEyigsWeJg
Pivot Query
Database table stores individual records into rows, some times these row data need to be transformed into column data called PIVOT. MySQL doesn't provide PIVOT table, a PIVOT table can be created by GROUP_CONCAT, COUNT, SUM
https://t.co/ZwpoygEvDw
#java#mysql#wesome
Junit 5 Pioneer RangeSource
JUnit Pioneer RangeSource is an implementation of the ArgumentsSource interface. It can be used to provide a series of numbers as input to a @ParameterizedTest annotation.
#wesome
https://t.co/FMuESPO5EF
Junit 5 TestWatcher
Junit 5 provides a lot of ways to extend the functionality provided by default. if we want to extend and execute custom code after JUnit 5 test case for that JUnit 5 provides us TestWatcher interface.
Junit 5 Pioneer @SetEnvironmentVariable
JUnit Jupiter pioneer @SetEnvironmentVariable is used to temporarily set the environment property for test execution. Once the test execution completes, its default value will be restored.
#wesome
https://t.co/9Y6QGGhzqw
JUnit5 Custom @Tag Specific Gradle Task
@Tag Meta Annotation allows us to combine multiple, we can create a custom @Tag Specific Gradle Task to run the required scenario of the test case.
Junit 5 Pioneer @DefaultLocale
JUnit 5 pioneer provides @DefaultLocale annotation to temporarily change the locale value for test execution. Once the test execution completes, its default value will be restored.
#wesome
https://t.co/WisT0z3OS4
Junit 5 Pioneer @RepeatFailedTest
Code depends on external conditions, which we can't control, Test cases on those conditions may fail, we should retry the test case before marking as failed. JUnit Pioneer provides @RepeatFailedTest annotation.
#wesome
https://t.co/bXNWkGI8A8
Junit 5 Pioneer @ClearEnvironmentVariable
JUnit Jupiter pioneer @ClearEnvironmentVariable is used to temporarily clear the environment variables for test execution. Once the test execution completes, its default value will be restored.
#wesome
https://t.co/YOE3WswoYQ
Bit Manipulation
In computers everything is stored as a bit, in simple words 0 and 1, every integer every number are internally stored as a bit. 1 byte contains 8 bits.
https://t.co/M52nnS7LQA
Junit 5 Pioneer
JUnit 5 provides a lot of new features and a lot of default implementations, which can be overridden to extend functionality. we have other extensions that provide even more robust functionality, JUnit-pioneer is one of them.
#wesome
https://t.co/Vcr15SYTWc
Junit 5 Custom Display Name Generator
Junit 5 defines all the requirements of the Display Name Generator in the DisplayNameGenerator interface. It allows us to implement the interface and create a custom Display Name Generator.
https://t.co/cNUcseIolU