@@ -77,20 +77,11 @@ public void testSaveCredentials_success() {
77
77
ActivityController <TestActivity > controller = Robolectric .buildActivity (TestActivity .class ).setup ();
78
78
TestActivity testActivity = controller .get ();
79
79
80
- // In a real test, you might inject a mock or fake CredentialManager
81
- // that returns success. For simplicity, we rely on valid user/password
82
- // so the Handler will produce a SUCCESS Resource if no exceptions occur.
83
-
84
- // Mock a valid FirebaseUser
85
- // E.g., if your code checks user.email != null, ensure it's non-null
86
- // (We won't rely on mMockAuth in this example, but you could if needed.)
87
80
com .google .firebase .auth .FirebaseUser mockUser = TestHelper .getMockFirebaseUser ();
88
- // Make sure .getEmail() is non-null
89
81
org .mockito .Mockito .when (mockUser .getEmail ()).thenReturn (TestConstants .EMAIL );
90
82
91
- // Save with a non-null user and password => should produce LOADING -> SUCCESS
92
83
mHandler .saveCredentials (
93
- testActivity , // A mocked Activity or real, as needed
84
+ testActivity ,
94
85
mockUser ,
95
86
"test-password"
96
87
);
@@ -104,8 +95,6 @@ public void testSaveCredentials_failure() {
104
95
ActivityController <TestActivity > controller = Robolectric .buildActivity (TestActivity .class ).setup ();
105
96
TestActivity testActivity = controller .get ();
106
97
107
- // If we pass a null user or missing password,
108
- // the Handler should produce LOADING -> FAILURE
109
98
mHandler .saveCredentials (
110
99
testActivity ,
111
100
null , // invalid user
0 commit comments