@Test(expected = CRestException.class) public void shouldThrowExceptionWhenParamProcessingFail() throws Exception { Param mockParam = mock(Param.class); Exception exception = new Exception(); ParamProcessor paramProcessor = mock(ParamProcessor.class); when(paramProcessor.process(mockParam, UTF8, true)).thenThrow(exception); ParamConfig paramConfig = mock(ParamConfig.class); when(paramConfig.getParamProcessor()).thenReturn(paramProcessor); when(mockParam.getParamConfig()).thenReturn(paramConfig); try { ParamProcessors.iterate(asList(mockParam), UTF8).hasNext(); } catch (Exception e) { assertSame(exception, e.getCause()); throw e; } }
public static Iterator<EncodedPair> iterate(List<Param> params, Charset charset){ return iterate(params, charset, true); }
ParamProcessors { public static Iterator<EncodedPair> iterate(List<Param> params, Charset charset){ return iterate(params, charset, true); } }
ParamProcessors { public static Iterator<EncodedPair> iterate(List<Param> params, Charset charset){ return iterate(params, charset, true); } private  ParamProcessors(); }
ParamProcessors { public static Iterator<EncodedPair> iterate(List<Param> params, Charset charset){ return iterate(params, charset, true); } private  ParamProcessors(); static ParamProcessor newInstance(ParamType type, String listSeparator); static Iterator<EncodedPair> iterate(List<Param> params, Charset charset); static Iterator<EncodedPair> iterate(List<Param> params, Charset charset, boolean encodeIfNeeded); }
ParamProcessors { public static Iterator<EncodedPair> iterate(List<Param> params, Charset charset){ return iterate(params, charset, true); } private  ParamProcessors(); static ParamProcessor newInstance(ParamType type, String listSeparator); static Iterator<EncodedPair> iterate(List<Param> params, Charset charset); static Iterator<EncodedPair> iterate(List<Param> params, Charset charset, boolean encodeIfNeeded);  }