use of io.spine.core.MessageRejection in project core-java by SpineEventEngine.
the class StatusesShould method create_invalid_argument_status_exception.
@Test
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
public void create_invalid_argument_status_exception() {
final MessageRejection rejection = new UnsupportedEventException(Sample.messageOfType(ProjectCreated.class));
final StatusRuntimeException statusRuntimeEx = invalidArgumentWithCause(rejection);
final Error actualError = MetadataConverter.toError(statusRuntimeEx.getTrailers()).get();
assertEquals(Status.INVALID_ARGUMENT.getCode(), statusRuntimeEx.getStatus().getCode());
assertEquals(rejection, statusRuntimeEx.getCause());
assertEquals(rejection.asError(), actualError);
}
Aggregations