Add integration test, bump version to 0.0.4

This commit is contained in:
Jacob Stopak 2019-04-23 23:38:51 -07:00
parent 8463567986
commit a2002dde52
3 changed files with 17 additions and 3 deletions

View File

@ -10,7 +10,7 @@
</parent> </parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>pass-exception-to-client-json-spring-boot</artifactId> <artifactId>pass-exception-to-client-json-spring-boot</artifactId>
<version>0.0.3-SNAPSHOT</version> <version>0.0.4-SNAPSHOT</version>
<name>pass-exception-to-client-json-spring-boot</name> <name>pass-exception-to-client-json-spring-boot</name>
<description>Baeldung article code on how to pass exceptions to client in JSON format using Spring Boot</description> <description>Baeldung article code on how to pass exceptions to client in JSON format using Spring Boot</description>

View File

@ -13,9 +13,7 @@ public class ErrorHandler {
@ExceptionHandler(CustomException.class) @ExceptionHandler(CustomException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public CustomException handleCustomException(CustomException ce) { public CustomException handleCustomException(CustomException ce) {
return ce; return ce;
} }
} }

View File

@ -0,0 +1,16 @@
package com.baeldung.passexceptiontoclientjsonspringboot;
import org.junit.Test;
public class MainControllerIntegrationTest {
@Test(expected = CustomException.class)
public void givenIndex_thenCustomException() throws CustomException {
MainController mainController = new MainController();
mainController.index();
}
}