@Test public void makeMultiple() throws Exception { assertTrue(factory.make(IMDB_HTML) instanceof MixedMovieFinder); }
public MovieFinder make(DocumentSourceType documentSourceType) { switch (documentSourceType) { case IMDB_HTML: return new BasicMovieFinder(IMDB_HTML, new IMDBHTMLExchangeStrategy(), config); case OMDB: return new BasicMovieFinder(OMDB, new OMDBExchangeStrategy(config), config); default: throw new IllegalArgumentException("Invalid movie finder type!"); } }
MovieFinderFactory { public MovieFinder make(DocumentSourceType documentSourceType) { switch (documentSourceType) { case IMDB_HTML: return new BasicMovieFinder(IMDB_HTML, new IMDBHTMLExchangeStrategy(), config); case OMDB: return new BasicMovieFinder(OMDB, new OMDBExchangeStrategy(config), config); default: throw new IllegalArgumentException("Invalid movie finder type!"); } } }
MovieFinderFactory { public MovieFinder make(DocumentSourceType documentSourceType) { switch (documentSourceType) { case IMDB_HTML: return new BasicMovieFinder(IMDB_HTML, new IMDBHTMLExchangeStrategy(), config); case OMDB: return new BasicMovieFinder(OMDB, new OMDBExchangeStrategy(config), config); default: throw new IllegalArgumentException("Invalid movie finder type!"); } } @Inject  MovieFinderFactory(Config config); }
MovieFinderFactory { public MovieFinder make(DocumentSourceType documentSourceType) { switch (documentSourceType) { case IMDB_HTML: return new BasicMovieFinder(IMDB_HTML, new IMDBHTMLExchangeStrategy(), config); case OMDB: return new BasicMovieFinder(OMDB, new OMDBExchangeStrategy(config), config); default: throw new IllegalArgumentException("Invalid movie finder type!"); } } @Inject  MovieFinderFactory(Config config); MovieFinder make(DocumentSourceType documentSourceType); MovieFinder make(DocumentSourceType... documentSourceTypes); }
MovieFinderFactory { public MovieFinder make(DocumentSourceType documentSourceType) { switch (documentSourceType) { case IMDB_HTML: return new BasicMovieFinder(IMDB_HTML, new IMDBHTMLExchangeStrategy(), config); case OMDB: return new BasicMovieFinder(OMDB, new OMDBExchangeStrategy(config), config); default: throw new IllegalArgumentException("Invalid movie finder type!"); } } @Inject  MovieFinderFactory(Config config); MovieFinder make(DocumentSourceType documentSourceType); MovieFinder make(DocumentSourceType... documentSourceTypes);  }