@Test public void collect_A$_TimeoutWithDefaultValues() throws Exception { HttpGetToStringMultiLane multiLane = new HttpGetToStringMultiLane(); HttpGetToStringAction httpGet = new HttpGetToStringAction("http://localhost:8881/", 1); multiLane.start("req-1", httpGet, "Unavailable"); multiLane.start("req-2", httpGet, "Unavailable"); Map<String, Either<Throwable, String>> results = multiLane.collect(); assertThat(results.size(), is(equalTo(2))); assertThat(results.get("req-1").isLeft(), is(true)); assertThat(results.get("req-2").isLeft(), is(true)); }
@Test public void collect_A$() throws Exception { HttpGetToStringMultiLane multiLane = new HttpGetToStringMultiLane(); HttpGetToStringAction httpGet = new HttpGetToStringAction("http://localhost:8881/?v=abc", 1000); multiLane.start("req-1", httpGet); multiLane.start("req-2", httpGet); Map<String, Either<Throwable, String>> results = multiLane.collect(); assertThat(results.size(), is(equalTo(2))); assertThat(results.get("req-1").right().getOrElse(""), is(equalTo("abc"))); assertThat(results.get("req-2").right().getOrElse(""), is(equalTo("abc"))); }