AbstractRequestInterceptor implements RequestInterceptor { public ParamConfigBuilder newParamConfig(Class<?> type){ return newParamConfig(type, type); } AbstractRequestInterceptor(CRestConfig crestConfig); ParamConfigBuilder newParamConfig(Class<?> type); ParamConfigBuilder newParamConfig(Class<?> type, Type genericType);  }
@Test public void newParamConfigShouldBuildANewParamConfigWithGivenArg(){ ParamConfigBuilder expected = mock(ParamConfigBuilder.class); when(paramConfigBuilderFactory.newInstance(String.class, String.class)).thenReturn(expected); ParamConfigBuilder actual = toTest.newParamConfig(String.class); assertSame(expected, actual); }
@Test public void newParamConfigShouldBuildANewParamConfigWithGivenArgs(){ ParamConfigBuilder expected = mock(ParamConfigBuilder.class); when(paramConfigBuilderFactory.newInstance(String.class, Integer.class)).thenReturn(expected); ParamConfigBuilder actual = toTest.newParamConfig(String.class, Integer.class); assertSame(expected, actual); }