Skip to content

Commit a2002dd

Browse files
Add integration test, bump version to 0.0.4
1 parent 8463567 commit a2002dd

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

spring-boot-exceptions/pass-exception-to-client-json-spring-boot/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>com.baeldung</groupId>
1212
<artifactId>pass-exception-to-client-json-spring-boot</artifactId>
13-
<version>0.0.3-SNAPSHOT</version>
13+
<version>0.0.4-SNAPSHOT</version>
1414
<name>pass-exception-to-client-json-spring-boot</name>
1515
<description>Baeldung article code on how to pass exceptions to client in JSON format using Spring Boot</description>
1616

spring-boot-exceptions/pass-exception-to-client-json-spring-boot/src/main/java/com/baeldung/passexceptiontoclientjsonspringboot/ErrorHandler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ public class ErrorHandler {
1313
@ExceptionHandler(CustomException.class)
1414
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
1515
public CustomException handleCustomException(CustomException ce) {
16-
1716
return ce;
18-
1917
}
2018

2119
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.baeldung.passexceptiontoclientjsonspringboot;
2+
3+
import org.junit.Test;
4+
5+
public class MainControllerIntegrationTest {
6+
7+
@Test(expected = CustomException.class)
8+
public void givenIndex_thenCustomException() throws CustomException {
9+
10+
MainController mainController = new MainController();
11+
12+
mainController.index();
13+
14+
}
15+
16+
}

0 commit comments

Comments
 (0)