SlideShare a Scribd company logo
1 of 70
Download to read offline
JUnit
New Opportunities for Testing on the JVM
Sam Brannen
@sam_brannen

1
@sam_brannen#SpringOne #JUnit5
Sam Brannen
•  Spring and Java Consultant
•  Trainer, Coach, …
•  Hardcore developer at heart
•  Java Developer for about 20 years
•  Spring Framework Core Committer since 2007
•  JUnit 5 Core Committer since October 2015
@sam_brannen#SpringOne #JUnit5
Experts in Spring and Enterprise Java
Areas of expertise
•  Spring *
•  JUnit 5
•  Java EE
•  Software Architecture
•  Code Reviews
Where you find us
•  Zurich, Switzerland
•  @swiftmind
•  http://www.swiftmind.com
@sam_brannen#SpringOne #JUnit5
Agenda
•  Impetus for Change
•  JUnit 5
•  Demos
•  Live Coding
•  Spring 5
•  Q & A
@sam_brannen#SpringOne #JUnit5
Show of hands …
@sam_brannen#SpringOne #JUnit5
Why a new version of JUnit?
@sam_brannen#SpringOne #JUnit5
Impetus for Change
•  JUnit 4.0 was released a decade ago
•  a lot has changed since then…
•  testing needs have matured
•  expectations have grown
•  Modularity à big ball of mud (i.e., only THE junit.jar)
•  Test discovery and execution à tightly coupled
•  Extensibility à lot of room for improvement
•  Let’s not forget Java 8 and Java 9 and …
@sam_brannen#SpringOne #JUnit5
JUnit 4 Runner API
•  Very powerful
•  In fact, it can do anything
•  But… you can’t combine Runners
•  Parameterized + SpringRunner à no way
@sam_brannen#SpringOne #JUnit5
JUnit 4… Rules… are meant to be broken
•  JUnit 4.7: MethodRule à @Rule
•  JUnit 4.9: TestRule à @Rule / @ClassRule
•  Great for simple use cases
•  Can even be combined
•  But… a single rule can’t be used for method-level and class-level callbacks
•  Plus… zero support for instance-level callbacks
•  Case in point: SpringClassRule / SpringMethodRule
@sam_brannen#SpringOne #JUnit5
JUnit Lambda – Crowdfunding Campaign
•  Initiated by Johannes Link and Marc Philipp
•  Later joined by Matthias Merdes, Stefan Bechtold, &
Sam Brannen
•  Ran from July to October 2015
•  Raised 53,937 Euros from 474 individuals and
companies
•  4 companies donated 6 weeks of developer time
@sam_brannen#SpringOne #JUnit5
Thanks!
@sam_brannen#SpringOne #JUnit5
The Kick-off Team
@sam_brannen#SpringOne #JUnit5
JUnit 5
@sam_brannen#SpringOne #JUnit5
Roadmap
•  Prototype à December 2nd, 2015
•  5.0.0-ALPHA à February 1st, 2016
•  Milestones & RCs à July 2016 – August 2017
•  5.0.0 GA à September 10th, 2017
•  5.0.1 à October 3rd, 2017
•  5.0.2 à November 12th, 2017 ✅
•  5.1 M1 à November 19th, 2017 🚧
@sam_brannen#SpringOne #JUnit5
JUnit 5 – in a Nutshell
•  Modular
•  Extensible
•  Modern
•  Forward and backward compatible
•  JUnit Platform supports JUnit 3.8, JUnit 4, and JUnit 5
•  New testing frameworks can be run with JUnit 4 infrastructure
o  @RunWith(JUnitPlatform.class)
@sam_brannen#SpringOne #JUnit5
JUnit 5 – Java Versions
•  Java 8
•  baseline
•  but can be used to test application code compiled against previous JDK versions
•  Java 9
•  #WorksFineOnJDK9
•  every artifact has a stable AUTOMATIC-MODULE-NAME
•  module-path scanning support coming in 5.1
•  Java 10
•  We just started building against EA builds recently
@sam_brannen#SpringOne #JUnit5
JUnit 5 = Platform + Jupiter + Vintage
•  JUnit Platform 1.0.0
•  Foundation for launching testing frameworks on the JVM
•  Launcher and TestEngine APIs
•  ConsoleLauncher, Gradle plugin, Maven Surefire provider
•  JUnit Jupiter 5.0.0
•  New programming model and extension model for JUnit 5
•  JUnit Vintage 4.12.0
•  TestEngine for running JUnit 3 and JUnit 4 based tests
Revolutionary
Evolutionary
Necessary
@sam_brannen#SpringOne #JUnit5
Launcher API
•  Used by IDEs and build tools to launch the framework
•  Central API for discovering and executing tests via one or more engines
•  LauncherDiscoveryRequest
•  selectors and filters
•  Feedback provided via the TestExecutionListener API
•  ConsoleLauncher for command-line support
@sam_brannen#SpringOne #JUnit5
TestEngine API
•  Test engine discovers and executes tests
•  for a particular programming model
•  Automatic registration via Java’s ServiceLoader mechanism
•  JupiterTestEngine
•  VintageTestEngine
•  Implement your own…
@sam_brannen#SpringOne #JUnit5
Third-party TestEngines
•  Specsy
•  Spek
•  Cucumber
•  Drools Scenario
•  jqwik
source: https://github.com/junit-team/junit5/wiki/Third-party-Extensions
P L A T F O R M
J U P I T E RV I N T A G E
P A R T Y
T H I R D
PLATFORM
JUPITER
VINTAGE
PARTY
THIRD
@sam_brannen#SpringOne #JUnit5
IDEs and Build Tools
•  IntelliJ: ✅ IDEA 2016.2+ (2017.2.5)
•  Eclipse: ✅ Eclipse Oxygen 4.7.1a
•  NetBeans: 🙉🙈🙊
•  Gradle: interim solution from JUnit Team
•  to be taken over by Gradle team (end of 2017)
•  Android JUnit 5: third-party Android support
•  Maven: interim solution from JUnit Team
•  being taken over by Maven Surefire team
See user guide and
sample apps for examples
@sam_brannen#SpringOne #JUnit5
So, what is JUnit Jupiter?
@sam_brannen#SpringOne #JUnit5
JUnit Jupiter – Extension Model
•  Extension
•  marker interface
•  org.junit.jupiter.api.extension
•  package containing all extension APIs
•  implement as many as you like
•  @ExtendWith(...)
•  used to register one or more extensions
•  interface, class, or method level
o  or as a meta-annotation
@sam_brannen#SpringOne #JUnit5
Extension APIs
•  BeforeAllCallback
•  BeforeEachCallback
•  BeforeTestExecutionCallback
•  AfterTestExecutionCallback
•  AfterEachCallback
•  AfterAllCallback
•  TestExecutionExceptionHandler
•  ExecutionCondition
•  TestInstancePostProcessor
•  ParameterResolver
•  TestTemplateInvocationContextProvider
Lifecycle Callbacks
Dependency Injection
@sam_brannen#SpringOne #JUnit5
JUnit Jupiter – Programming Model
org.junit.jupiter.api (org.junit.jupiter.params)
•  Annotations and meta-annotations
•  Assertions and Assumptions
•  Custom display names
•  Visibility
•  Tagging
•  Conditional test execution
•  Dependency injection for constructors and methods
•  Lambda expressions and method references
•  Interface default methods
•  Nested test classes
•  Repeated tests, parameterized tests, dynamic tests
@sam_brannen#SpringOne #JUnit5
Annotations
•  @Test / @TestFactory and @Testable for TestEngine implementors
•  @RepeatedTest / @ParameterizedTest and @TestTemplate
•  @Nested
•  @TestInstance
•  @BeforeAll / @AfterAll
•  @BeforeEach / @AfterEach
•  @DisplayName
•  @Tag
•  @Disabled
@sam_brannen#SpringOne #JUnit5
JUnit 4 Rule Migration Support
•  @EnableRuleMigrationSupport
o  located in experimental junit-jupiter-migrationsupport module
o  registers 3 extensions for JUnit Jupiter
•  ExternalResourceSupport
o  TemporaryFolder, etc.
•  VerifierSupport
o  ErrorCollector, etc.
•  ExpectedExceptionSupport
o  ExpectedException
o  minor bugs in 5.0.0; fixed in 5.0.1and 5.0.2
@sam_brannen#SpringOne #JUnit5
Assertions
org.junit.jupiter.api.Assertions
•  Limited set of core assertions
•  assertEquals(), assertNotNull(), etc.
•  assertThrows() – λ
•  assertTimeout() and assertTimeoutPreemptively() – λ
•  assertAll() – λ
•  Supplier<String> à λ for lazy failure message evaluation
•  message is now the last parameter
•  For more power, use AssertJ, Hamcrest, etc.
@sam_brannen#SpringOne #JUnit5
Assumptions
org.junit.jupiter.api.Assumptions
•  Limited set of core assumptions
•  For aborting tests mid-flight
•  Otherwise, favor a custom ExecutionCondition for skipping
•  assumeTrue() / assumeFalse()
•  BooleanSupplier, Supplier<String> – λ
•  assumingThat( ? , () -> {} ); – λ
@sam_brannen#SpringOne #JUnit5
LIVE CODING DEMO
from JUnit 4 to JUnit Jupiter
@sam_brannen#SpringOne #JUnit5
Tagging
@Tag("fast")
@Test
void myFastTest() {
}
•  Declare @Tag on a test interface, class, or method
@sam_brannen#SpringOne #JUnit5
Custom Tags
@Target(METHOD)
@Retention(RUNTIME)
@Tag("fast")
public @interface Fast {
}
•  Declare @Tag as a meta-annotation
@Fast
@Test
void myFastTest() {}
@sam_brannen#SpringOne #JUnit5
Composed Tags
@Target(METHOD)
@Retention(RUNTIME)
@Tag("fast")
@Test
public @interface FastTest {
}
•  Declare @Tag as a meta-annotation with other annotations (JUnit, Spring, etc.)
@FastTest
void myFastTest() {
}
@sam_brannen#SpringOne #JUnit5
Test Names
•  Names default to test class or test method names
•  characters limited based on Java syntax
•  Custom display names à @DisplayName
•  Can contain spaces, special chars, and even emoji 😱
@sam_brannen#SpringOne #JUnit5
Dependency Injection
•  Extension Model meets Programming Model
•  ParameterResolver extension API
•  resolves parameters for @Test and lifecycle methods
o  and even constructors
•  can register multiple simultaneously
•  only one wins
•  Use cases
•  server URL, DataSource, Spring ApplicationContext, etc.
@sam_brannen#SpringOne #JUnit5
TestInfo
•  TestInfo: inject into constructor, @Test, @BeforeEach, etc.
•  access display name, tags, class, method
•  TestInfoParameterResolver
•  eating our own dog food ;-)
•  See also:
•  RepetitionInfo for @RepeatedTest
•  TestReporter
•  MockitoExtension
•  SpringExtension
@sam_brannen#SpringOne #JUnit5
What’s the significance of @Disabled?
@sam_brannen#SpringOne #JUnit5
Conditional Test Execution
•  Extension Model meets Programming Model
•  ExecutionCondition
•  @Disabled
•  DisabledCondition
•  eating our own dog food ;-)
•  Deactivate via Launcher, system property, or junit-platform.properties file
•  junit.conditions.deactivate = org.junit.*
Game Changer
@sam_brannen#SpringOne #JUnit5
LIVE CODING DEMO
tags, display names, dependency injection, & conditions
@sam_brannen#SpringOne #JUnit5
Testing Traits?
@sam_brannen#SpringOne #JUnit5
Interface Default Methods
•  Enables the concept of a test interface
•  leading to multiple inheritance in tests
•  a.k.a., testing traits
•  @BeforeAll / @AfterAll
•  if using @TestInstance(Lifecyle.PER_CLASS)
•  @BeforeEach / @AfterEach
•  @Test / @RepeatedTest / @ParameterizedTest / @TestFactory
•  @Tag
•  @ExtendWith
•  See StringTests and TestInterfaceDemo examples in user guide
@sam_brannen#SpringOne #JUnit5
DEMO
default methods
@sam_brannen#SpringOne #JUnit5
Nested Test Classes
•  Enables logical, hierarchical grouping of test classes
•  with shared initialization and state from outer classes
•  Declare @Nested on non-static nested classes
•  i.e., inner classes
•  You can even combine nested classes and test interfaces
•  See TestingAStack example in user guide and Bowling Game Kata by Tim Riemer
@sam_brannen#SpringOne #JUnit5
DEMO
nested test classes
@sam_brannen#SpringOne #JUnit5
Test Templates?
@sam_brannen#SpringOne #JUnit5
Repeated Tests
•  Annotate a method with @RepeatedTest instead of @Test
o  and specify the number of repetitions
•  Optionally have the RepetitionInfo injected as a method parameter
•  Optionally override the display name
@sam_brannen#SpringOne #JUnit5
@RepeatedTest in Action
@RepeatedTest(5)
void repeatedTest(RepetitionInfo repetitionInfo) {
assertEquals(5, repetitionInfo.getTotalRepetitions());
}
@RepeatedTest(
value = 5,
name = "Wiederholung {currentRepetition} von {totalRepetitions}”
)
void repeatedTestInGerman() {
// ...
}
@sam_brannen#SpringOne #JUnit5
Parameterized Tests (junit-jupiter-params)
•  Annotate a method with @ParameterizedTest instead of @Test
o  and specify the source of the arguments
o  optionally override the display name
•  Sources
o  @ValueSource: String, int, long, double
o  @EnumSource
o  @MethodSource
o  @CsvSource & @CsvFileSource
o  @ArgumentsSource & custom ArgumentsProvider
@sam_brannen#SpringOne #JUnit5
Argument Conversion
•  Implicit conversion
o  Primitive types and their wrappers
o  Enums
o  java.time types (JSR-310)
•  Explicit conversion
o  @ConvertWith and custom ArgumentConverter
o  @JavaTimeConversionPattern built-in support for JSR-310
@sam_brannen#SpringOne #JUnit5
@ParameterizedTest in Action
@ParameterizedTest
@ValueSource(strings = {
"mom",
"dad",
"radar",
"racecar",
"able was I ere I saw elba"
})
void palindromes(String candidate) {
assertTrue(isPalindrome(candidate));
}
@sam_brannen#SpringOne #JUnit5
DEMO
repeated and parameterized tests
@sam_brannen#SpringOne #JUnit5
Lambdas as Tests?
@sam_brannen#SpringOne #JUnit5
Dynamic Tests
•  Conventional tests are static (i.e., known at compile time)
•  @Test
•  A DynamicTest is registered at runtime – λ
•  as lambda expression in a stream, collection, etc.
•  by a method annotated with @TestFactory
•  Can also register a DynamicContainer for dynamic nesting
•  Somewhat analogous to parameterized tests
•  just more… dynamic 🤓
@sam_brannen#SpringOne #JUnit5
Dynamic Tests in Action
@TestFactory
Stream<DynamicTest> dynamicTestsFromIntStream() {
// Generates tests for the first 10 even integers.
return IntStream.iterate(0, n -> n + 2)
.limit(10)
.mapToObj(n ->
dynamicTest("test" + n,
() -> assertTrue(n % 2 == 0)));
}
@sam_brannen#SpringOne #JUnit5
DEMO
dynamic tests
@sam_brannen#SpringOne #JUnit5
What’s Missing?
•  Scenario tests
•  Ordering
•  Parallel execution
•  Execution in user-defined thread
•  Declarative and programmatic test suites for the JUnit Platform
•  Java 9 module-path scanning
•  …
@sam_brannen#SpringOne #JUnit5
LIVE CODING DEMO
custom extensions
•  logging
•  timing
•  conditions
@sam_brannen#SpringOne #JUnit5
Spring 5 + JUnit 5
@sam_brannen#SpringOne #JUnit5
Spring Support for JUnit Jupiter
•  Fully integrated in Spring Framework 5.0!
•  Supports all Core Spring TestContext Framework features
•  Constructor and method injection via @Autowired, @Qualifier, @Value
•  Conditional test execution via SpEL expressions
•  ApplicationContext configuration annotations
•  Also works with Spring Framework 4.3
https://github.com/sbrannen/spring-test-junit5
@sam_brannen#SpringOne #JUnit5
Configuring JUnit Jupiter with Spring
•  SpringExtension
•  @ExtendWith(SpringExtension.class)
•  @SpringJUnitConfig
•  @ContextConfiguration + SpringExtension
•  @SpringJUnitWebConfig
•  @SpringJUnitConfig + @WebAppConfiguration
•  @EnabledIf / @DisabledIf
•  SpEL expression evaluation for conditional execution
@sam_brannen#SpringOne #JUnit5
DEMO
Spring 5 and JUnit Jupiter
@EnabledOnMac / @DisabledOnMac
@sam_brannen#SpringOne #JUnit5
Spring Boot 1.4+ & JUnit 5 – Custom Config
@Target(TYPE)
@Retention(RUNTIME)
@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = MOCK)
@AutoConfigureMockMvc
@Transactional
public @interface SpringEventsWebTest {
}
•  @SpringBootTest + @AutoConfigureMockMvc + @ExtendWith(SpringExtension.class)
@sam_brannen#SpringOne #JUnit5
Spring Boot 1.4+ & JUnit 5 – MockMvc Test
@SpringEventsWebTest
class EventsControllerTests {
@Test
@DisplayName("Home page should display more than 10 events")
void listEvents(@Autowired MockMvc mockMvc) throws Exception {
mockMvc.perform(get("/"))
.andExpect(view().name("event/list"))
.andExpect(model().attribute("events",
hasSize(greaterThan(10))));
}
}
•  @SpringEventsWebTest + method-level DI + MockMvc
@sam_brannen#SpringOne #JUnit5
In closing …
@sam_brannen#SpringOne #JUnit5
JUnit 5 Resources
Project Homepage à http://junit.org/junit5
User Guide à http://junit.org/junit5/docs/current/user-guide
Javadoc à http://junit.org/junit5/docs/current/api
GitHub à https://github.com/junit-team
Gitter à https://gitter.im/junit-team/junit5
Stack Overflow à http://stackoverflow.com/tags/junit5
@sam_brannen#SpringOne #JUnit5
Spring Resources
Spring Framework à http://projects.spring.io/spring-framework
Spring Guides à http://spring.io/guides
Spring JIRA à https://jira.spring.io
Spring on GitHub à https://github.com/spring-projects/spring-framework
Stack Overflow à spring, spring-test, spring-mvc, spring-boot, …
@sam_brannen#SpringOne #JUnit5
Demos Used in this Presentation
https://github.com/sbrannen/junit5-demo
@sam_brannen#SpringOne #JUnit5
Q & A
Sam Brannen
JUnit

More Related Content

What's hot

Testing Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsTesting Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsSam Brannen
 
Spring Testing Features
Spring Testing FeaturesSpring Testing Features
Spring Testing FeaturesGil Zilberfeld
 
Testing Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkTesting Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkDmytro Chyzhykov
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Appschrisb206 chrisb206
 
Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Rossen Stoyanchev
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questionsKuldeep Pawar
 
A journey with Target Platforms
A journey with Target PlatformsA journey with Target Platforms
A journey with Target PlatformsMickael Istria
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in YiiIlPeach
 
Springboot introduction
Springboot introductionSpringboot introduction
Springboot introductionSagar Verma
 
Android with dagger_2
Android with dagger_2Android with dagger_2
Android with dagger_2Kros Huang
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiFlorent Batard
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for AndroidHazem Saleh
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with CodeceptionJeremy Coates
 
Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013Hazem Saleh
 
Test automation - Building effective solutions
Test automation - Building effective solutionsTest automation - Building effective solutions
Test automation - Building effective solutionsArtem Nagornyi
 
Robot framework Gowthami Goli
Robot framework Gowthami GoliRobot framework Gowthami Goli
Robot framework Gowthami GoliGowthami Buddi
 
Testing PHP with Codeception
Testing PHP with CodeceptionTesting PHP with Codeception
Testing PHP with CodeceptionJohn Paul Ada
 

What's hot (20)

Spring Test Framework
Spring Test FrameworkSpring Test Framework
Spring Test Framework
 
Testing Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsTesting Spring MVC and REST Web Applications
Testing Spring MVC and REST Web Applications
 
Spring Testing Features
Spring Testing FeaturesSpring Testing Features
Spring Testing Features
 
Testing Web Apps with Spring Framework
Testing Web Apps with Spring FrameworkTesting Web Apps with Spring Framework
Testing Web Apps with Spring Framework
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2Testing Web Apps with Spring Framework 3.2
Testing Web Apps with Spring Framework 3.2
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questions
 
A journey with Target Platforms
A journey with Target PlatformsA journey with Target Platforms
A journey with Target Platforms
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in Yii
 
Angular 2 in-1
Angular 2 in-1 Angular 2 in-1
Angular 2 in-1
 
Springboot introduction
Springboot introductionSpringboot introduction
Springboot introduction
 
Android with dagger_2
Android with dagger_2Android with dagger_2
Android with dagger_2
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
 
[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android[AnDevCon 2016] Mutation Testing for Android
[AnDevCon 2016] Mutation Testing for Android
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with Codeception
 
PL/SQL unit testing with Ruby
PL/SQL unit testing with RubyPL/SQL unit testing with Ruby
PL/SQL unit testing with Ruby
 
Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013Efficient JavaScript Unit Testing, JavaOne China 2013
Efficient JavaScript Unit Testing, JavaOne China 2013
 
Test automation - Building effective solutions
Test automation - Building effective solutionsTest automation - Building effective solutions
Test automation - Building effective solutions
 
Robot framework Gowthami Goli
Robot framework Gowthami GoliRobot framework Gowthami Goli
Robot framework Gowthami Goli
 
Testing PHP with Codeception
Testing PHP with CodeceptionTesting PHP with Codeception
Testing PHP with Codeception
 

Similar to JUnit 5 — New Opportunities for Testing on the JVM

Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperMike Melusky
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperMike Melusky
 
JUnit 5 Slides: Next generation Framework for Testing
JUnit 5 Slides: Next generation Framework for TestingJUnit 5 Slides: Next generation Framework for Testing
JUnit 5 Slides: Next generation Framework for TestingSurinder Mehra
 
KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfQA or the Highway
 
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
An Introduction to JUnit 5 and how to use it with Spring boot tests and MockitoAn Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockitoshaunthomas999
 
5 Key Metrics to Release Better Software Faster
5 Key Metrics to Release Better Software Faster5 Key Metrics to Release Better Software Faster
5 Key Metrics to Release Better Software FasterDynatrace
 
Renaissance of JUnit - Introduction to JUnit 5
Renaissance of JUnit - Introduction to JUnit 5Renaissance of JUnit - Introduction to JUnit 5
Renaissance of JUnit - Introduction to JUnit 5Jimmy Lu
 
Innovation in Action - #MFSummit2017
Innovation in Action - #MFSummit2017Innovation in Action - #MFSummit2017
Innovation in Action - #MFSummit2017Micro Focus
 
Testing for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayTesting for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayBizTalk360
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum
 
20171215 andoird-test-night
20171215 andoird-test-night20171215 andoird-test-night
20171215 andoird-test-nightKazuaki Matsuo
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarCypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarApplitools
 
Selenium Deep Dive
Selenium Deep DiveSelenium Deep Dive
Selenium Deep DiveAnand Bagmar
 
Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023Scott Keck-Warren
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewBlue Elephant Consulting
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentationsayhi2sudarshan
 
Mobile App Quality Roadmap for DevTest Teams
Mobile App Quality Roadmap for DevTest TeamsMobile App Quality Roadmap for DevTest Teams
Mobile App Quality Roadmap for DevTest TeamsPerfecto by Perforce
 
Engineering Principles in Practice
Engineering Principles in PracticeEngineering Principles in Practice
Engineering Principles in PracticeArdy Dedase
 
Level Up Your Salesforce Unit Testing
Level Up Your Salesforce Unit TestingLevel Up Your Salesforce Unit Testing
Level Up Your Salesforce Unit TestingGordon Bockus
 

Similar to JUnit 5 — New Opportunities for Testing on the JVM (20)

Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
JUnit 5 Slides: Next generation Framework for Testing
JUnit 5 Slides: Next generation Framework for TestingJUnit 5 Slides: Next generation Framework for Testing
JUnit 5 Slides: Next generation Framework for Testing
 
KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdf
 
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
An Introduction to JUnit 5 and how to use it with Spring boot tests and MockitoAn Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
 
5 Key Metrics to Release Better Software Faster
5 Key Metrics to Release Better Software Faster5 Key Metrics to Release Better Software Faster
5 Key Metrics to Release Better Software Faster
 
Renaissance of JUnit - Introduction to JUnit 5
Renaissance of JUnit - Introduction to JUnit 5Renaissance of JUnit - Introduction to JUnit 5
Renaissance of JUnit - Introduction to JUnit 5
 
Innovation in Action - #MFSummit2017
Innovation in Action - #MFSummit2017Innovation in Action - #MFSummit2017
Innovation in Action - #MFSummit2017
 
Testing for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayTesting for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration Monday
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
 
20171215 andoird-test-night
20171215 andoird-test-night20171215 andoird-test-night
20171215 andoird-test-night
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarCypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
 
Selenium Deep Dive
Selenium Deep DiveSelenium Deep Dive
Selenium Deep Dive
 
Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final Review
 
Selenium web driver_2.0_presentation
Selenium web driver_2.0_presentationSelenium web driver_2.0_presentation
Selenium web driver_2.0_presentation
 
Mobile App Quality Roadmap for DevTest Teams
Mobile App Quality Roadmap for DevTest TeamsMobile App Quality Roadmap for DevTest Teams
Mobile App Quality Roadmap for DevTest Teams
 
Engineering Principles in Practice
Engineering Principles in PracticeEngineering Principles in Practice
Engineering Principles in Practice
 
Level Up Your Salesforce Unit Testing
Level Up Your Salesforce Unit TestingLevel Up Your Salesforce Unit Testing
Level Up Your Salesforce Unit Testing
 

More from VMware Tanzu

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItVMware Tanzu
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023VMware Tanzu
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleVMware Tanzu
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023VMware Tanzu
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductVMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready AppsVMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware Tanzu
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfVMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptxVMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchVMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishVMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - FrenchVMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023VMware Tanzu
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootVMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerVMware Tanzu
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeVMware Tanzu
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsVMware Tanzu
 

More from VMware Tanzu (20)

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

JUnit 5 — New Opportunities for Testing on the JVM

  • 1. JUnit New Opportunities for Testing on the JVM Sam Brannen @sam_brannen 1
  • 2. @sam_brannen#SpringOne #JUnit5 Sam Brannen •  Spring and Java Consultant •  Trainer, Coach, … •  Hardcore developer at heart •  Java Developer for about 20 years •  Spring Framework Core Committer since 2007 •  JUnit 5 Core Committer since October 2015
  • 3. @sam_brannen#SpringOne #JUnit5 Experts in Spring and Enterprise Java Areas of expertise •  Spring * •  JUnit 5 •  Java EE •  Software Architecture •  Code Reviews Where you find us •  Zurich, Switzerland •  @swiftmind •  http://www.swiftmind.com
  • 4. @sam_brannen#SpringOne #JUnit5 Agenda •  Impetus for Change •  JUnit 5 •  Demos •  Live Coding •  Spring 5 •  Q & A
  • 6. @sam_brannen#SpringOne #JUnit5 Why a new version of JUnit?
  • 7. @sam_brannen#SpringOne #JUnit5 Impetus for Change •  JUnit 4.0 was released a decade ago •  a lot has changed since then… •  testing needs have matured •  expectations have grown •  Modularity à big ball of mud (i.e., only THE junit.jar) •  Test discovery and execution à tightly coupled •  Extensibility à lot of room for improvement •  Let’s not forget Java 8 and Java 9 and …
  • 8. @sam_brannen#SpringOne #JUnit5 JUnit 4 Runner API •  Very powerful •  In fact, it can do anything •  But… you can’t combine Runners •  Parameterized + SpringRunner à no way
  • 9. @sam_brannen#SpringOne #JUnit5 JUnit 4… Rules… are meant to be broken •  JUnit 4.7: MethodRule à @Rule •  JUnit 4.9: TestRule à @Rule / @ClassRule •  Great for simple use cases •  Can even be combined •  But… a single rule can’t be used for method-level and class-level callbacks •  Plus… zero support for instance-level callbacks •  Case in point: SpringClassRule / SpringMethodRule
  • 10. @sam_brannen#SpringOne #JUnit5 JUnit Lambda – Crowdfunding Campaign •  Initiated by Johannes Link and Marc Philipp •  Later joined by Matthias Merdes, Stefan Bechtold, & Sam Brannen •  Ran from July to October 2015 •  Raised 53,937 Euros from 474 individuals and companies •  4 companies donated 6 weeks of developer time
  • 14. @sam_brannen#SpringOne #JUnit5 Roadmap •  Prototype à December 2nd, 2015 •  5.0.0-ALPHA à February 1st, 2016 •  Milestones & RCs à July 2016 – August 2017 •  5.0.0 GA à September 10th, 2017 •  5.0.1 à October 3rd, 2017 •  5.0.2 à November 12th, 2017 ✅ •  5.1 M1 à November 19th, 2017 🚧
  • 15. @sam_brannen#SpringOne #JUnit5 JUnit 5 – in a Nutshell •  Modular •  Extensible •  Modern •  Forward and backward compatible •  JUnit Platform supports JUnit 3.8, JUnit 4, and JUnit 5 •  New testing frameworks can be run with JUnit 4 infrastructure o  @RunWith(JUnitPlatform.class)
  • 16. @sam_brannen#SpringOne #JUnit5 JUnit 5 – Java Versions •  Java 8 •  baseline •  but can be used to test application code compiled against previous JDK versions •  Java 9 •  #WorksFineOnJDK9 •  every artifact has a stable AUTOMATIC-MODULE-NAME •  module-path scanning support coming in 5.1 •  Java 10 •  We just started building against EA builds recently
  • 17. @sam_brannen#SpringOne #JUnit5 JUnit 5 = Platform + Jupiter + Vintage •  JUnit Platform 1.0.0 •  Foundation for launching testing frameworks on the JVM •  Launcher and TestEngine APIs •  ConsoleLauncher, Gradle plugin, Maven Surefire provider •  JUnit Jupiter 5.0.0 •  New programming model and extension model for JUnit 5 •  JUnit Vintage 4.12.0 •  TestEngine for running JUnit 3 and JUnit 4 based tests Revolutionary Evolutionary Necessary
  • 18. @sam_brannen#SpringOne #JUnit5 Launcher API •  Used by IDEs and build tools to launch the framework •  Central API for discovering and executing tests via one or more engines •  LauncherDiscoveryRequest •  selectors and filters •  Feedback provided via the TestExecutionListener API •  ConsoleLauncher for command-line support
  • 19. @sam_brannen#SpringOne #JUnit5 TestEngine API •  Test engine discovers and executes tests •  for a particular programming model •  Automatic registration via Java’s ServiceLoader mechanism •  JupiterTestEngine •  VintageTestEngine •  Implement your own…
  • 20. @sam_brannen#SpringOne #JUnit5 Third-party TestEngines •  Specsy •  Spek •  Cucumber •  Drools Scenario •  jqwik source: https://github.com/junit-team/junit5/wiki/Third-party-Extensions
  • 21. P L A T F O R M J U P I T E RV I N T A G E P A R T Y T H I R D
  • 23. @sam_brannen#SpringOne #JUnit5 IDEs and Build Tools •  IntelliJ: ✅ IDEA 2016.2+ (2017.2.5) •  Eclipse: ✅ Eclipse Oxygen 4.7.1a •  NetBeans: 🙉🙈🙊 •  Gradle: interim solution from JUnit Team •  to be taken over by Gradle team (end of 2017) •  Android JUnit 5: third-party Android support •  Maven: interim solution from JUnit Team •  being taken over by Maven Surefire team See user guide and sample apps for examples
  • 25. @sam_brannen#SpringOne #JUnit5 JUnit Jupiter – Extension Model •  Extension •  marker interface •  org.junit.jupiter.api.extension •  package containing all extension APIs •  implement as many as you like •  @ExtendWith(...) •  used to register one or more extensions •  interface, class, or method level o  or as a meta-annotation
  • 26. @sam_brannen#SpringOne #JUnit5 Extension APIs •  BeforeAllCallback •  BeforeEachCallback •  BeforeTestExecutionCallback •  AfterTestExecutionCallback •  AfterEachCallback •  AfterAllCallback •  TestExecutionExceptionHandler •  ExecutionCondition •  TestInstancePostProcessor •  ParameterResolver •  TestTemplateInvocationContextProvider Lifecycle Callbacks Dependency Injection
  • 27. @sam_brannen#SpringOne #JUnit5 JUnit Jupiter – Programming Model org.junit.jupiter.api (org.junit.jupiter.params) •  Annotations and meta-annotations •  Assertions and Assumptions •  Custom display names •  Visibility •  Tagging •  Conditional test execution •  Dependency injection for constructors and methods •  Lambda expressions and method references •  Interface default methods •  Nested test classes •  Repeated tests, parameterized tests, dynamic tests
  • 28. @sam_brannen#SpringOne #JUnit5 Annotations •  @Test / @TestFactory and @Testable for TestEngine implementors •  @RepeatedTest / @ParameterizedTest and @TestTemplate •  @Nested •  @TestInstance •  @BeforeAll / @AfterAll •  @BeforeEach / @AfterEach •  @DisplayName •  @Tag •  @Disabled
  • 29. @sam_brannen#SpringOne #JUnit5 JUnit 4 Rule Migration Support •  @EnableRuleMigrationSupport o  located in experimental junit-jupiter-migrationsupport module o  registers 3 extensions for JUnit Jupiter •  ExternalResourceSupport o  TemporaryFolder, etc. •  VerifierSupport o  ErrorCollector, etc. •  ExpectedExceptionSupport o  ExpectedException o  minor bugs in 5.0.0; fixed in 5.0.1and 5.0.2
  • 30. @sam_brannen#SpringOne #JUnit5 Assertions org.junit.jupiter.api.Assertions •  Limited set of core assertions •  assertEquals(), assertNotNull(), etc. •  assertThrows() – λ •  assertTimeout() and assertTimeoutPreemptively() – λ •  assertAll() – λ •  Supplier<String> à λ for lazy failure message evaluation •  message is now the last parameter •  For more power, use AssertJ, Hamcrest, etc.
  • 31. @sam_brannen#SpringOne #JUnit5 Assumptions org.junit.jupiter.api.Assumptions •  Limited set of core assumptions •  For aborting tests mid-flight •  Otherwise, favor a custom ExecutionCondition for skipping •  assumeTrue() / assumeFalse() •  BooleanSupplier, Supplier<String> – λ •  assumingThat( ? , () -> {} ); – λ
  • 32. @sam_brannen#SpringOne #JUnit5 LIVE CODING DEMO from JUnit 4 to JUnit Jupiter
  • 33. @sam_brannen#SpringOne #JUnit5 Tagging @Tag("fast") @Test void myFastTest() { } •  Declare @Tag on a test interface, class, or method
  • 34. @sam_brannen#SpringOne #JUnit5 Custom Tags @Target(METHOD) @Retention(RUNTIME) @Tag("fast") public @interface Fast { } •  Declare @Tag as a meta-annotation @Fast @Test void myFastTest() {}
  • 35. @sam_brannen#SpringOne #JUnit5 Composed Tags @Target(METHOD) @Retention(RUNTIME) @Tag("fast") @Test public @interface FastTest { } •  Declare @Tag as a meta-annotation with other annotations (JUnit, Spring, etc.) @FastTest void myFastTest() { }
  • 36. @sam_brannen#SpringOne #JUnit5 Test Names •  Names default to test class or test method names •  characters limited based on Java syntax •  Custom display names à @DisplayName •  Can contain spaces, special chars, and even emoji 😱
  • 37. @sam_brannen#SpringOne #JUnit5 Dependency Injection •  Extension Model meets Programming Model •  ParameterResolver extension API •  resolves parameters for @Test and lifecycle methods o  and even constructors •  can register multiple simultaneously •  only one wins •  Use cases •  server URL, DataSource, Spring ApplicationContext, etc.
  • 38. @sam_brannen#SpringOne #JUnit5 TestInfo •  TestInfo: inject into constructor, @Test, @BeforeEach, etc. •  access display name, tags, class, method •  TestInfoParameterResolver •  eating our own dog food ;-) •  See also: •  RepetitionInfo for @RepeatedTest •  TestReporter •  MockitoExtension •  SpringExtension
  • 39. @sam_brannen#SpringOne #JUnit5 What’s the significance of @Disabled?
  • 40. @sam_brannen#SpringOne #JUnit5 Conditional Test Execution •  Extension Model meets Programming Model •  ExecutionCondition •  @Disabled •  DisabledCondition •  eating our own dog food ;-) •  Deactivate via Launcher, system property, or junit-platform.properties file •  junit.conditions.deactivate = org.junit.* Game Changer
  • 41. @sam_brannen#SpringOne #JUnit5 LIVE CODING DEMO tags, display names, dependency injection, & conditions
  • 43. @sam_brannen#SpringOne #JUnit5 Interface Default Methods •  Enables the concept of a test interface •  leading to multiple inheritance in tests •  a.k.a., testing traits •  @BeforeAll / @AfterAll •  if using @TestInstance(Lifecyle.PER_CLASS) •  @BeforeEach / @AfterEach •  @Test / @RepeatedTest / @ParameterizedTest / @TestFactory •  @Tag •  @ExtendWith •  See StringTests and TestInterfaceDemo examples in user guide
  • 45. @sam_brannen#SpringOne #JUnit5 Nested Test Classes •  Enables logical, hierarchical grouping of test classes •  with shared initialization and state from outer classes •  Declare @Nested on non-static nested classes •  i.e., inner classes •  You can even combine nested classes and test interfaces •  See TestingAStack example in user guide and Bowling Game Kata by Tim Riemer
  • 48. @sam_brannen#SpringOne #JUnit5 Repeated Tests •  Annotate a method with @RepeatedTest instead of @Test o  and specify the number of repetitions •  Optionally have the RepetitionInfo injected as a method parameter •  Optionally override the display name
  • 49. @sam_brannen#SpringOne #JUnit5 @RepeatedTest in Action @RepeatedTest(5) void repeatedTest(RepetitionInfo repetitionInfo) { assertEquals(5, repetitionInfo.getTotalRepetitions()); } @RepeatedTest( value = 5, name = "Wiederholung {currentRepetition} von {totalRepetitions}” ) void repeatedTestInGerman() { // ... }
  • 50. @sam_brannen#SpringOne #JUnit5 Parameterized Tests (junit-jupiter-params) •  Annotate a method with @ParameterizedTest instead of @Test o  and specify the source of the arguments o  optionally override the display name •  Sources o  @ValueSource: String, int, long, double o  @EnumSource o  @MethodSource o  @CsvSource & @CsvFileSource o  @ArgumentsSource & custom ArgumentsProvider
  • 51. @sam_brannen#SpringOne #JUnit5 Argument Conversion •  Implicit conversion o  Primitive types and their wrappers o  Enums o  java.time types (JSR-310) •  Explicit conversion o  @ConvertWith and custom ArgumentConverter o  @JavaTimeConversionPattern built-in support for JSR-310
  • 52. @sam_brannen#SpringOne #JUnit5 @ParameterizedTest in Action @ParameterizedTest @ValueSource(strings = { "mom", "dad", "radar", "racecar", "able was I ere I saw elba" }) void palindromes(String candidate) { assertTrue(isPalindrome(candidate)); }
  • 55. @sam_brannen#SpringOne #JUnit5 Dynamic Tests •  Conventional tests are static (i.e., known at compile time) •  @Test •  A DynamicTest is registered at runtime – λ •  as lambda expression in a stream, collection, etc. •  by a method annotated with @TestFactory •  Can also register a DynamicContainer for dynamic nesting •  Somewhat analogous to parameterized tests •  just more… dynamic 🤓
  • 56. @sam_brannen#SpringOne #JUnit5 Dynamic Tests in Action @TestFactory Stream<DynamicTest> dynamicTestsFromIntStream() { // Generates tests for the first 10 even integers. return IntStream.iterate(0, n -> n + 2) .limit(10) .mapToObj(n -> dynamicTest("test" + n, () -> assertTrue(n % 2 == 0))); }
  • 58. @sam_brannen#SpringOne #JUnit5 What’s Missing? •  Scenario tests •  Ordering •  Parallel execution •  Execution in user-defined thread •  Declarative and programmatic test suites for the JUnit Platform •  Java 9 module-path scanning •  …
  • 59. @sam_brannen#SpringOne #JUnit5 LIVE CODING DEMO custom extensions •  logging •  timing •  conditions
  • 61. @sam_brannen#SpringOne #JUnit5 Spring Support for JUnit Jupiter •  Fully integrated in Spring Framework 5.0! •  Supports all Core Spring TestContext Framework features •  Constructor and method injection via @Autowired, @Qualifier, @Value •  Conditional test execution via SpEL expressions •  ApplicationContext configuration annotations •  Also works with Spring Framework 4.3 https://github.com/sbrannen/spring-test-junit5
  • 62. @sam_brannen#SpringOne #JUnit5 Configuring JUnit Jupiter with Spring •  SpringExtension •  @ExtendWith(SpringExtension.class) •  @SpringJUnitConfig •  @ContextConfiguration + SpringExtension •  @SpringJUnitWebConfig •  @SpringJUnitConfig + @WebAppConfiguration •  @EnabledIf / @DisabledIf •  SpEL expression evaluation for conditional execution
  • 63. @sam_brannen#SpringOne #JUnit5 DEMO Spring 5 and JUnit Jupiter @EnabledOnMac / @DisabledOnMac
  • 64. @sam_brannen#SpringOne #JUnit5 Spring Boot 1.4+ & JUnit 5 – Custom Config @Target(TYPE) @Retention(RUNTIME) @ExtendWith(SpringExtension.class) @SpringBootTest(webEnvironment = MOCK) @AutoConfigureMockMvc @Transactional public @interface SpringEventsWebTest { } •  @SpringBootTest + @AutoConfigureMockMvc + @ExtendWith(SpringExtension.class)
  • 65. @sam_brannen#SpringOne #JUnit5 Spring Boot 1.4+ & JUnit 5 – MockMvc Test @SpringEventsWebTest class EventsControllerTests { @Test @DisplayName("Home page should display more than 10 events") void listEvents(@Autowired MockMvc mockMvc) throws Exception { mockMvc.perform(get("/")) .andExpect(view().name("event/list")) .andExpect(model().attribute("events", hasSize(greaterThan(10)))); } } •  @SpringEventsWebTest + method-level DI + MockMvc
  • 67. @sam_brannen#SpringOne #JUnit5 JUnit 5 Resources Project Homepage à http://junit.org/junit5 User Guide à http://junit.org/junit5/docs/current/user-guide Javadoc à http://junit.org/junit5/docs/current/api GitHub à https://github.com/junit-team Gitter à https://gitter.im/junit-team/junit5 Stack Overflow à http://stackoverflow.com/tags/junit5
  • 68. @sam_brannen#SpringOne #JUnit5 Spring Resources Spring Framework à http://projects.spring.io/spring-framework Spring Guides à http://spring.io/guides Spring JIRA à https://jira.spring.io Spring on GitHub à https://github.com/spring-projects/spring-framework Stack Overflow à spring, spring-test, spring-mvc, spring-boot, …
  • 69. @sam_brannen#SpringOne #JUnit5 Demos Used in this Presentation https://github.com/sbrannen/junit5-demo
  • 70. @sam_brannen#SpringOne #JUnit5 Q & A Sam Brannen JUnit