Add integration test, bump version to 0.0.4
This commit is contained in:
parent
8463567986
commit
a2002dde52
|
@ -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>
|
||||
|
||||
|
|
|
@ -13,9 +13,7 @@ public class ErrorHandler {
|
|||
@ExceptionHandler(CustomException.class)
|
||||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
public CustomException handleCustomException(CustomException ce) {
|
||||
|
||||
return ce;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue