This repository has been archived by the owner on May 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JsonSchemaValidatonException and JsonValidationLoggerHelper
- Loading branch information
Artur Synowiec
committed
Feb 2, 2018
1 parent
f4f8b52
commit 8e122f0
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...pi-core/src/main/java/uk/gov/justice/services/core/json/JsonSchemaValidatonException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package uk.gov.justice.services.core.json; | ||
|
||
public class JsonSchemaValidatonException extends RuntimeException { | ||
|
||
private static final long serialVersionUID = -9004984738197385375L; | ||
|
||
public JsonSchemaValidatonException(final String message, final Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...-api-core/src/main/java/uk/gov/justice/services/core/json/JsonValidationLoggerHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package uk.gov.justice.services.core.json; | ||
|
||
import javax.json.JsonObject; | ||
|
||
public interface JsonValidationLoggerHelper { | ||
|
||
String toValidationTrace(final JsonSchemaValidatonException jsonSchemaValidatonException); | ||
JsonObject toJsonObject(final JsonSchemaValidatonException jsonSchemaValidatonException); | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
...ore/src/test/java/uk/gov/justice/services/core/json/JsonSchemaValidatonExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package uk.gov.justice.services.core.json; | ||
|
||
import static org.hamcrest.core.Is.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import org.junit.Test; | ||
|
||
public class JsonSchemaValidatonExceptionTest { | ||
|
||
@Test | ||
public void shouldCreateExceptionWithMessage() throws Exception { | ||
final JsonSchemaValidatonException exception = new JsonSchemaValidatonException("Test message", new Throwable()); | ||
assertThat(exception.getMessage(), is("Test message")); | ||
} | ||
|
||
} |