jkube
jkube copied to clipboard
(jkube-kit-generator-webapp): Replace JUnit4 with JUnit5
Component
jkube-kit-generator-webapp
Task description
Child of #1546
- Remove JUnit4 dependencies
- Add JUnit5 dependencies
- Refactor tests
@rohanKanojia please assign this to me
@manusa I rewrite these assertions https://github.com/eclipse/jkube/blob/cccc2864555f9e0959020d4c4fe4e817d587f865/jkube-kit/generator/webapp/src/test/java/org/eclipse/jkube/generator/webapp/handler/JettyAppSeverHandlerTest.java#L48-L49
like
assertThat(Files.createDirectory(temporaryFolder.toPath().resolve("META-INF")))
.satisfies(p -> assertThat(new File(p.toFile(), "jetty-logging.properties").createNewFile()).isTrue());
assertThat(Files.createDirectory(temporaryFolder.toPath().resolve("META-INF-1337")))
.satisfies(p -> assertThat(new File(p.toFile(), "context.xml").createNewFile()).isTrue());
please tell me a better way to assert these.
Those assertions were there to remove code smells. There's no need to assert these with the Files.xxx methods since these will fail in case they don't complete successfully.
If you see any assertion in the Given test block, they should only serve for this purpose, else there might be something wrong in the test implementation