Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Add JsonSchemaValidatonException and JsonValidationLoggerHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Synowiec committed Feb 2, 2018
1 parent f4f8b52 commit 8e122f0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to
## [Unreleased]

### Added
- exception JsonSchemaValidatonException
- Interface JsonValidationLoggerHelper
- Interface NamedToMediaTypeConverter

## [2.0.0] - 2018-01-29
Expand Down
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);
}

}
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);

}
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"));
}

}

0 comments on commit 8e122f0

Please sign in to comment.