From: Kai Moritz Date: Sun, 27 Sep 2020 17:59:16 +0000 (+0200) Subject: WIP:Further refined the example... X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=2d263a51cb8b7b46cd00288e9b625017bb5d797c;p=demos%2Ftesting WIP:Further refined the example... * The view renders the question, if no answer is specified (initial request!) * If a valid request is specified, the answer and the outcome is rendered * If an invalid request (negative number!) is specified, the view generates an exception, because it tries to resolve the Optional anyway --- diff --git a/src/main/java/de/juplo/demo/ExampleService.java b/src/main/java/de/juplo/demo/ExampleService.java index 375e8f7..ec21629 100644 --- a/src/main/java/de/juplo/demo/ExampleService.java +++ b/src/main/java/de/juplo/demo/ExampleService.java @@ -1,6 +1,5 @@ package de.juplo.demo; -import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; import java.util.Optional; diff --git a/src/test/java/de/juplo/demo/ExceptionHandlingApplicationTests.java b/src/test/java/de/juplo/demo/ExceptionHandlingApplicationTests.java index 5d3ca21..b7891e4 100644 --- a/src/test/java/de/juplo/demo/ExceptionHandlingApplicationTests.java +++ b/src/test/java/de/juplo/demo/ExceptionHandlingApplicationTests.java @@ -3,7 +3,6 @@ package de.juplo.demo; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import org.mockito.Mockito; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired;