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