OMDBExchangeStrategy extends AbstractExchangeStrategy { @Override public Connection.Request buildRequest(@NonNull Movie movie) { val searchLink = "http: val queryParams = new ImmutableMap.Builder<String, String>() .put("t", movie.getTitle()) .put("plot", "short") .put("r", "json") .put("apikey", config.getString("omdbApiKey")) .build(); return HttpConnection.connect(HttpUtils.buildURL(searchLink, queryParams)) .ignoreContentType(true) .request(); } @Inject  OMDBExchangeStrategy(Config config); @Override Connection.Request buildRequest(@NonNull Movie movie);  }
@Test @Override public void buildRequestWithValidMovies() throws Exception { for (Movie movie : MovieTestData.MOVIES_LIST) { URL searchURL = strategy.buildRequest(movie).url(); String decodedURL = URLDecoder.decode(searchURL.toString(), StandardCharsets.UTF_8.toString()); assertTrue(decodedURL.contains("t=" + movie.getTitle())); } }