@Test public void shouldAddJacksonNetworkResponserIfPresent() { given(ClassUtils.isPresent(JACKSON_2_X_CLASS_NAME)).willReturn(false); given(ClassUtils.isPresent(JACKSON_1_X_CLASS_NAME)).willReturn(true); Matcher<TypedNetworkResponseParser> matcher = argMatcher(new PlainMatcher(){ @Override public boolean matches(Object item) { if (item instanceof JacksonNetworkResponseParser) { return true; } return false; }}); DefaultNetworkResponseParserFactory.addJacksonParserIfPresent(builder); verify(builder).addParser(Matchers.argThat(matcher)); }
public static void addJacksonParserIfPresent(IntegratedNetworkResponseParser.Builder builder) { if(ClassUtils.isPresent(JACKSON_2_X_CLASS_NAME)) { builder.addParser(new Jackson2NetworkResponseParser()); return; } if(ClassUtils.isPresent(JACKSON_1_X_CLASS_NAME)) { builder.addParser(new JacksonNetworkResponseParser()); return; } }
DefaultNetworkResponseParserFactory { public static void addJacksonParserIfPresent(IntegratedNetworkResponseParser.Builder builder) { if(ClassUtils.isPresent(JACKSON_2_X_CLASS_NAME)) { builder.addParser(new Jackson2NetworkResponseParser()); return; } if(ClassUtils.isPresent(JACKSON_1_X_CLASS_NAME)) { builder.addParser(new JacksonNetworkResponseParser()); return; } } }
DefaultNetworkResponseParserFactory { public static void addJacksonParserIfPresent(IntegratedNetworkResponseParser.Builder builder) { if(ClassUtils.isPresent(JACKSON_2_X_CLASS_NAME)) { builder.addParser(new Jackson2NetworkResponseParser()); return; } if(ClassUtils.isPresent(JACKSON_1_X_CLASS_NAME)) { builder.addParser(new JacksonNetworkResponseParser()); return; } }  }
DefaultNetworkResponseParserFactory { public static void addJacksonParserIfPresent(IntegratedNetworkResponseParser.Builder builder) { if(ClassUtils.isPresent(JACKSON_2_X_CLASS_NAME)) { builder.addParser(new Jackson2NetworkResponseParser()); return; } if(ClassUtils.isPresent(JACKSON_1_X_CLASS_NAME)) { builder.addParser(new JacksonNetworkResponseParser()); return; } }  static NetworkResponseParser create(); static void addJacksonParserIfPresent(IntegratedNetworkResponseParser.Builder builder); static void addSimpleXmlParserIfPresent(IntegratedNetworkResponseParser.Builder builder); }
DefaultNetworkResponseParserFactory { public static void addJacksonParserIfPresent(IntegratedNetworkResponseParser.Builder builder) { if(ClassUtils.isPresent(JACKSON_2_X_CLASS_NAME)) { builder.addParser(new Jackson2NetworkResponseParser()); return; } if(ClassUtils.isPresent(JACKSON_1_X_CLASS_NAME)) { builder.addParser(new JacksonNetworkResponseParser()); return; } }  static NetworkResponseParser create(); static void addJacksonParserIfPresent(IntegratedNetworkResponseParser.Builder builder); static void addSimpleXmlParserIfPresent(IntegratedNetworkResponseParser.Builder builder);  }