From 2d263a51cb8b7b46cd00288e9b625017bb5d797c Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 27 Sep 2020 19:59:16 +0200 Subject: [PATCH] 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 --- src/main/java/de/juplo/demo/ExampleService.java | 1 - .../java/de/juplo/demo/ExceptionHandlingApplicationTests.java | 1 - 2 files changed, 2 deletions(-) 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; -- 2.20.1