Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
@Test
public void saveUsername_revealsUsersPlace_onSuccess() {
User user = createUser(USER_ID, A_USERNAME);
givenDelegate(userApiResourceDelegate)
.succeed().withResult(null) // <-- This is because the result has type Void
.when().saveUser(eq(USER_ID), same(user));
PlaceRequest placeRequestToGoAfterSave = new PlaceRequest.Builder()
.nameToken(NameTokens.USERS).build();
presenter.saveUser(user);
verify(placeManager).revealPlace(placeRequestToGoAfterSave);
}
@Test
public void saveUsername_delegatesToService() {
User user = createUser(USER_ID, A_USERNAME);
presenter.saveUser(user);
verify(userApi).saveUser(eq(USER_ID), same(user));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment