@Test public void reload_fail() { User user = new User(); FirebaseUser firebaseUser = Mockito.mock(FirebaseUser.class); Mockito.when(firebaseAuth.getCurrentUser()).thenReturn(firebaseUser); Mockito.when(task.isSuccessful()).thenReturn(false); Mockito.when(firebaseUser.reload()).thenReturn(task); user.reload(); Mockito.verify(firebaseUser, VerificationModeFactory.times(1)).reload(); }
@Override public Promise<GdxFirebaseUser> reload() { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser().reload())); }
User implements AuthUserDistribution { @Override public Promise<GdxFirebaseUser> reload() { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser().reload())); } }
User implements AuthUserDistribution { @Override public Promise<GdxFirebaseUser> reload() { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser().reload())); }  }
User implements AuthUserDistribution { @Override public Promise<GdxFirebaseUser> reload() { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser().reload())); }  @Override Promise<GdxFirebaseUser> updateEmail(String newEmail); @Override Promise<GdxFirebaseUser> sendEmailVerification(); @Override Promise<GdxFirebaseUser> updatePassword(char[] newPassword); @Override Promise<Void> delete(); @Override Promise<GdxFirebaseUser> reload(); }
User implements AuthUserDistribution { @Override public Promise<GdxFirebaseUser> reload() { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser().reload())); }  @Override Promise<GdxFirebaseUser> updateEmail(String newEmail); @Override Promise<GdxFirebaseUser> sendEmailVerification(); @Override Promise<GdxFirebaseUser> updatePassword(char[] newPassword); @Override Promise<Void> delete(); @Override Promise<GdxFirebaseUser> reload();  }