Merge "Fix ContentCaptureManagerTest test fail." into rvc-dev am: 3361dd2ad3
Change-Id: Ie4788677e235f066af2d210f7a59ceb98b356325
This commit is contained in:
@@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user