Search in sources :

Example 1 with InvalidEventException

use of io.spine.server.event.InvalidEventException in project core-java by SpineEventEngine.

the class InvalidEventExceptionShould method create_exception_with_violations.

@Test
public void create_exception_with_violations() {
    final StringValue msg = Wrapper.forString("");
    final InvalidEventException exception = InvalidEventException.onConstraintViolations(msg, singletonList(ConstraintViolation.getDefaultInstance()));
    assertNotNull(exception.getMessage());
    assertNotNull(exception.getError());
    assertEquals(msg, exception.getEventMessage());
}
Also used : InvalidEventException(io.spine.server.event.InvalidEventException) StringValue(com.google.protobuf.StringValue) Test(org.junit.Test)

Aggregations

StringValue (com.google.protobuf.StringValue)1 InvalidEventException (io.spine.server.event.InvalidEventException)1 Test (org.junit.Test)1