@Test(expected = IllegalArgumentException.class) public void getConverter_NO_HANDLING_CONVERTER_FOUND() { XSettings xsettings1 = mock(XSettings.class); when(facetValueConverter1.handles(xsettings1)).thenReturn(false); when(facetValueConverter2.handles(xsettings1)).thenReturn(false); manager.getConverter(xsettings1); }
public FacetValueConverter getConverter(XSettings xsettings) { Preconditions.checkNotNull(xsettings); for (FacetValueConverter converter :converters) { if (converter.handles(xsettings)) { return converter; } } throw new IllegalArgumentException("no FacetValueConverter can be found for " + xsettings); }
FacetValueConverterManager { public FacetValueConverter getConverter(XSettings xsettings) { Preconditions.checkNotNull(xsettings); for (FacetValueConverter converter :converters) { if (converter.handles(xsettings)) { return converter; } } throw new IllegalArgumentException("no FacetValueConverter can be found for " + xsettings); } }
FacetValueConverterManager { public FacetValueConverter getConverter(XSettings xsettings) { Preconditions.checkNotNull(xsettings); for (FacetValueConverter converter :converters) { if (converter.handles(xsettings)) { return converter; } } throw new IllegalArgumentException("no FacetValueConverter can be found for " + xsettings); }  }
FacetValueConverterManager { public FacetValueConverter getConverter(XSettings xsettings) { Preconditions.checkNotNull(xsettings); for (FacetValueConverter converter :converters) { if (converter.handles(xsettings)) { return converter; } } throw new IllegalArgumentException("no FacetValueConverter can be found for " + xsettings); }  FacetValueConverter getConverter(XSettings xsettings); void setConverters(List<? extends FacetValueConverter> converters); }
FacetValueConverterManager { public FacetValueConverter getConverter(XSettings xsettings) { Preconditions.checkNotNull(xsettings); for (FacetValueConverter converter :converters) { if (converter.handles(xsettings)) { return converter; } } throw new IllegalArgumentException("no FacetValueConverter can be found for " + xsettings); }  FacetValueConverter getConverter(XSettings xsettings); void setConverters(List<? extends FacetValueConverter> converters);  }