@Test public void updatePassword() { User user = new User(); FirebaseUser firebaseUser = Mockito.mock(FirebaseUser.class); Consumer consumer = Mockito.mock(Consumer.class); Mockito.when(firebaseAuth.getCurrentUser()).thenReturn(firebaseUser); Mockito.when(task.isSuccessful()).thenReturn(true); Mockito.when(firebaseUser.updatePassword(Mockito.anyString())).thenReturn(task); char[] arg1 = {'a', 'b', 'c'}; user.updatePassword(arg1).then(consumer); Mockito.verify(firebaseUser, VerificationModeFactory.times(1)).updatePassword(Mockito.eq(new String(arg1))); Mockito.verify(consumer, VerificationModeFactory.times(1)).accept(Mockito.any()); }
@Override public Promise<GdxFirebaseUser> updatePassword(char[] newPassword) { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser() .updatePassword(new String(newPassword)))); }
User implements AuthUserDistribution { @Override public Promise<GdxFirebaseUser> updatePassword(char[] newPassword) { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser() .updatePassword(new String(newPassword)))); } }
User implements AuthUserDistribution { @Override public Promise<GdxFirebaseUser> updatePassword(char[] newPassword) { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser() .updatePassword(new String(newPassword)))); }  }
User implements AuthUserDistribution { @Override public Promise<GdxFirebaseUser> updatePassword(char[] newPassword) { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser() .updatePassword(new String(newPassword)))); }  @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> updatePassword(char[] newPassword) { if (FirebaseAuth.getInstance().getCurrentUser() == null) { throw new IllegalStateException(); } return FuturePromise.when(new AuthPromiseConsumer<>(FirebaseAuth.getInstance().getCurrentUser() .updatePassword(new String(newPassword)))); }  @Override Promise<GdxFirebaseUser> updateEmail(String newEmail); @Override Promise<GdxFirebaseUser> sendEmailVerification(); @Override Promise<GdxFirebaseUser> updatePassword(char[] newPassword); @Override Promise<Void> delete(); @Override Promise<GdxFirebaseUser> reload();  }