Skip to content

Instantly share code, notes, and snippets.

@jbcpollak
Created November 13, 2013 02:33
Show Gist options
  • Save jbcpollak/7442644 to your computer and use it in GitHub Desktop.
Save jbcpollak/7442644 to your computer and use it in GitHub Desktop.
GeocodingFutureFactoryTest
public class AddressGeocodingFutureFactoryTest extends FutureFactoryTestBase {
@Test
public void testFuture() throws Exception {
GeocodingService geocodingService = mock(GeocodingService.class);
GeocodingFutureFactory gff = new GeocodingFutureFactory();
gff.setExecutionContext(ec);
gff.setGeocodingService(geocodingService);
final Address addr = new Address();
// the contents of addr are not necessary other than to verify the objects are the same
addr.setId(1394);
gff.makeFuture(addr);
// normally the Await function would be necessary, but we know we are running
// with the calling thread dispatcher here, so it isn't required.
verify(geocodingService).lookup(addr);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment