@Test
public void testSelectAlternativeOnlyOneEvent() throws Exception {
final ObjectContainer container = new ObjectContainer();
GeocoderPresenter presenter = new GeocoderPresenter(null, null);
presenter.setSelectAlternativeHandler(new SelectAlternativeHandler() {
public void onSelectAlternative(SelectAlternativeEvent event) {
Assert.fail("This handler should be overwritten");
}
});
presenter.setSelectAlternativeHandler(new SelectAlternativeHandler() {
public void onSelectAlternative(SelectAlternativeEvent event) {
container.object = "ok";
}
});
presenter.goToLocation(alternativesResponse, "4");