use of com.nike.backstopper.apierror.ApiError in project riposte by Nike-Inc.
the class ErrorResponseBodyImplTest method verifyAdapter.
private void verifyAdapter(ErrorResponseBodyImpl adapter, String expectedErrorId, List<ApiError> expectedErrors) {
assertThat(adapter.error_id, is(expectedErrorId));
assertThat(adapter.errorId(), is(expectedErrorId));
assertThat(adapter.errors.size(), is(expectedErrors.size()));
for (int i = 0; i < expectedErrors.size(); i++) {
ApiError apiError = expectedErrors.get(i);
DefaultErrorDTO errorView = adapter.errors.get(i);
assertThat(errorView.code, is(apiError.getErrorCode()));
assertThat(errorView.message, is(apiError.getMessage()));
}
}
use of com.nike.backstopper.apierror.ApiError in project riposte by Nike-Inc.
the class ErrorResponseBodyImplTest method errorResponseViewWrapperConstructorWorks.
@Test
public void errorResponseViewWrapperConstructorWorks() {
String errorUuid = UUID.randomUUID().toString();
List<ApiError> errorsList = Arrays.asList(BarebonesCoreApiErrorForTesting.NO_ACCEPTABLE_REPRESENTATION, BarebonesCoreApiErrorForTesting.UNSUPPORTED_MEDIA_TYPE);
DefaultErrorContractDTO errorContract = new DefaultErrorContractDTO(errorUuid, errorsList);
ErrorResponseBodyImpl adapter = new ErrorResponseBodyImpl(errorContract);
verifyAdapter(adapter, errorUuid, errorsList);
}
Aggregations