use of com.nike.backstopper.apierror.projectspecificinfo.ProjectApiErrors in project riposte by Nike-Inc.
the class BackstopperRiposteFrameworkErrorHandlerListenerTest method constructor_sets_projectApiErrors_to_passed_in_arg.
@Test
public void constructor_sets_projectApiErrors_to_passed_in_arg() {
// given
ProjectApiErrors projectErrorsMock = mock(ProjectApiErrors.class);
ApiError temporaryError = new ApiErrorBase("temp_error_for_test", 42, "temporary error", 503);
doReturn(temporaryError).when(projectErrorsMock).getTemporaryServiceProblemApiError();
// when
BackstopperRiposteFrameworkErrorHandlerListener impl = new BackstopperRiposteFrameworkErrorHandlerListener(projectErrorsMock);
// then
assertThat(impl.projectApiErrors).isSameAs(projectErrorsMock);
}
use of com.nike.backstopper.apierror.projectspecificinfo.ProjectApiErrors in project riposte by Nike-Inc.
the class RiposteApiExceptionHandlerTest method constructorWorksIfPassedValidValues.
@Test
public void constructorWorksIfPassedValidValues() {
// when
RiposteApiExceptionHandler myAdapter = new RiposteApiExceptionHandler(projectApiErrors, validListenerList, utils);
// then
List<ApiExceptionHandlerListener> actualListeners = (List<ApiExceptionHandlerListener>) Whitebox.getInternalState(myAdapter, "apiExceptionHandlerListenerList");
ProjectApiErrors actualProjectApiErrors = (ProjectApiErrors) Whitebox.getInternalState(myAdapter, "projectApiErrors");
ApiExceptionHandlerUtils actualUtils = (ApiExceptionHandlerUtils) Whitebox.getInternalState(myAdapter, "utils");
assertThat(actualListeners, is(validListenerList));
assertThat(actualProjectApiErrors, is(projectApiErrors));
assertThat(actualUtils, is(utils));
}
Aggregations