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>
<groupId>com.baeldung</groupId>
<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>
<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)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public CustomException handleCustomException(CustomException 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();
}
}