Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3361dd2a authored by Joanne Chung's avatar Joanne Chung Committed by Android (Google) Code Review
Browse files

Merge "Fix ContentCaptureManagerTest test fail." into rvc-dev

parents a5f08bda 3015adf9
Loading
Loading
Loading
Loading
+14 −9
Original line number Original line Diff line number Diff line
@@ -15,11 +15,12 @@
 */
 */
package android.view.contentcapture;
package android.view.contentcapture;


import static org.mockito.Mockito.mock;
import static org.testng.Assert.assertThrows;
import static org.testng.Assert.assertThrows;


import android.content.ContentCaptureOptions;
import android.content.Context;
import android.content.Context;


import org.junit.Before;
import org.junit.Test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mock;
@@ -37,16 +38,20 @@ public class ContentCaptureManagerTest {
    @Mock
    @Mock
    private Context mMockContext;
    private Context mMockContext;


    private ContentCaptureManager mManager;
    @Test

    public void testConstructor_invalidParametersThrowsException() {
    @Before
        assertThrows(NullPointerException.class,
    public void before() {
                () -> new ContentCaptureManager(mMockContext, /* service= */ null, /* options= */
        mManager = new ContentCaptureManager(mMockContext, /* service= */ null,
                        null));
                /* options= */ null);
    }
    }


    @Test
    @Test
    public void testRemoveData_invalid() {
    public void testRemoveData_invalidParametersThrowsException() {
        assertThrows(NullPointerException.class, () -> mManager.removeData(null));
        final IContentCaptureManager mockService = mock(IContentCaptureManager.class);
        final ContentCaptureOptions options = new ContentCaptureOptions(null);
        final ContentCaptureManager manager =
                new ContentCaptureManager(mMockContext, mockService, options);

        assertThrows(NullPointerException.class, () -> manager.removeData(null));
    }
    }
}
}