Search in sources :

Example 1 with ApiExceptionHandlerUtils

use of com.nike.backstopper.handler.ApiExceptionHandlerUtils 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));
}
Also used : List(java.util.List) ProjectApiErrors(com.nike.backstopper.apierror.projectspecificinfo.ProjectApiErrors) ApiExceptionHandlerListener(com.nike.backstopper.handler.listener.ApiExceptionHandlerListener) GenericApiExceptionHandlerListener(com.nike.backstopper.handler.listener.impl.GenericApiExceptionHandlerListener) ApiExceptionHandlerUtils(com.nike.backstopper.handler.ApiExceptionHandlerUtils) Test(org.junit.Test)

Aggregations

ProjectApiErrors (com.nike.backstopper.apierror.projectspecificinfo.ProjectApiErrors)1 ApiExceptionHandlerUtils (com.nike.backstopper.handler.ApiExceptionHandlerUtils)1 ApiExceptionHandlerListener (com.nike.backstopper.handler.listener.ApiExceptionHandlerListener)1 GenericApiExceptionHandlerListener (com.nike.backstopper.handler.listener.impl.GenericApiExceptionHandlerListener)1 List (java.util.List)1 Test (org.junit.Test)1