@Test public final void acceptTermsOfServiceSuccessTest() { final ActionProcessor processorMock = context.mock(ActionProcessor.class); final AnonymousClassInterceptor<AsyncCallback<Serializable>> acceptCallBackInt = new AnonymousClassInterceptor<AsyncCallback<Serializable>>(); context.checking(new Expectations() { { oneOf(sessionMock).getActionProcessor(); will(returnValue(processorMock)); oneOf(processorMock).makeRequest(with(equal("acceptTermsOfService")), with(aNull(Serializable.class)), with(any(AsyncCallback.class))); will(acceptCallBackInt); oneOf(eventBusMock).notifyObservers(with(any(TermsOfServiceAcceptedEvent.class))); } }); sut.acceptTermsOfService(); acceptCallBackInt.getObject().onSuccess(null); context.assertIsSatisfied(); }
public void acceptTermsOfService() { session.getActionProcessor().makeRequest("acceptTermsOfService", null, new AsyncCallback<Serializable>() { public void onFailure(final Throwable caught) { } public void onSuccess(final Serializable result) { eventBus.notifyObservers(new TermsOfServiceAcceptedEvent()); } }); }
TermsOfServiceDialogModel { public void acceptTermsOfService() { session.getActionProcessor().makeRequest("acceptTermsOfService", null, new AsyncCallback<Serializable>() { public void onFailure(final Throwable caught) { } public void onSuccess(final Serializable result) { eventBus.notifyObservers(new TermsOfServiceAcceptedEvent()); } }); } }
TermsOfServiceDialogModel { public void acceptTermsOfService() { session.getActionProcessor().makeRequest("acceptTermsOfService", null, new AsyncCallback<Serializable>() { public void onFailure(final Throwable caught) { } public void onSuccess(final Serializable result) { eventBus.notifyObservers(new TermsOfServiceAcceptedEvent()); } }); } TermsOfServiceDialogModel(final Session inSession, final EventBus inEventBus); }
TermsOfServiceDialogModel { public void acceptTermsOfService() { session.getActionProcessor().makeRequest("acceptTermsOfService", null, new AsyncCallback<Serializable>() { public void onFailure(final Throwable caught) { } public void onSuccess(final Serializable result) { eventBus.notifyObservers(new TermsOfServiceAcceptedEvent()); } }); } TermsOfServiceDialogModel(final Session inSession, final EventBus inEventBus); void acceptTermsOfService(); void setAgreeValue(final Boolean inAgree); Boolean getAgreeValue(); }
TermsOfServiceDialogModel { public void acceptTermsOfService() { session.getActionProcessor().makeRequest("acceptTermsOfService", null, new AsyncCallback<Serializable>() { public void onFailure(final Throwable caught) { } public void onSuccess(final Serializable result) { eventBus.notifyObservers(new TermsOfServiceAcceptedEvent()); } }); } TermsOfServiceDialogModel(final Session inSession, final EventBus inEventBus); void acceptTermsOfService(); void setAgreeValue(final Boolean inAgree); Boolean getAgreeValue();  }