JJUG CCC Spring 2018 memo

I didn't post ...

Still to come! Introduction to JUnit 5 / Ryo Shindo

--What you want from the test framework (important element) --Conciseness and readability

Setup (different)

---- Multi-module configuration (Junit 5 has 3 configurations!) --junit platform (test execution platform) --Does not work on launcher, IDE --junit jupitaer (new test API) ―― @Test - junit vintage --Migration support

Junit5.2 → Bill of Materials -It provides a good combination of module versions of ↑

What changed in the way the test was written

Petit changed

--Test method name -4 Test name = test method name - 5 @DisplayName

Quite changed (a nice new feature)

--Assertion - assertEquals --The order of arguments changes --Assertion grouping ―― 4 When there are multiple assertions in one test (@Test), if one mistake is made, the subsequent ones will not be executed. ―― 5 Will be executed! --assertAll () Multiply by lambda expression! All asserts and returns OK if all are OK --Exception validation - 4 @Test(expected = ...Exception.class) or try-catch -5 assertThrows (, describe the processing that will occur in the lambda expression)

Structured test / parameterized test

--Structure test ―― 4 public static class-> Inner class (group) for testing ―― 5 Inner class and test method can coexist using @ Nested

--Parameterization test -4 @Runwith (Theories.class ... test runner) @DAtaPoints`` @Theory - 5 junit-jupiter-param module / --... Parameterized test A function to put parameters in the arguments of the test method and turn them automatically.

Extended model

--How to extend the test class - 4 Runnner (@Runwith), Rule --5 @ExtendsWith, multiple specifications allowed

migration

  1. Rewrite --Change argument of assertEquals ... --Rule and Runner are rewritten as Extension
  2. Migration module (using Junit vintage)

Recommended Posts

JJUG CCC Spring 2018 memo
JJUG CCC 2018 Spring participation memo
JJUG CCC 2018 Spring Repo
I went to JJUG CCC 2019 Spring
I participated in JJUG CCC 2019 Spring
Spring retrospective memo
Summary of going to JJUG CCC 2019 Spring
[* Java *] I participated in JJUG CCC 2019 Spring
[Memo] JJUG Night Seminar
Spring Shell usage memo
Spring boot memo writing (1)
JJUG CCC 2018 Fall Repo
Spring boot memo writing (2)
[Personal memo] About Spring framework
JJUG CCC Fall 2018 document summary
Spring Security usage memo CSRF
Spring Framework self-study memo series_1
Spring Security usage memo Run-As
Spring Security Usage memo Method security
Spring Security usage memo Remember-Me
JJUG CCC 2019 Fall slide list
JJUG CCC 2017 Fall Report Java
Participated in JJUG CCC 2019 FALL
JJUG CCC 2019 Fall materials summarized
Spring Security usage memo CORS
Spring Security usage memo test
Spring boot controller method memo
Impressions of an engineer apprentice going to JJUG CCC 2018 Spring
◆ Spring Boot + gradle environment construction memo
spring framework Simple study memo (2): AOP
Spring Security usage memo response header
Memo after the first Spring project-MVC-
I participated in JJUG CCC 2019 fall
Spring Security usage memo session management
Spring Security usage memo Basic / mechanism
A memo that touched Spring Boot
Spring thorough introduction version upgrade memo
Memo after the first Spring project-Database-
I participated in JJUG CCC 2019 Fall.
Automatically generated memo from swagger condegen (spring) -1
Spring Security Usage Memo Domain Object Security (ACL)
Spring Boot environment construction memo on mac
Memo after the first Spring project-What is Spring-
Spring Boot + Thymeleaf BootStrap installation method memo
[* Java *] I went to JJUG CCC 2017 Fall