Clean up the arguments annotation and verify items on IpMemoryStoreTest.
Bug: 131133347
Test: atest FrameworksNetTests
Merged-In: I8ce3bed435fbbb814d71fe48ffd305ff3f947f3f
Merged-In: I1db13a48b59d743482436ecf8a20d7f12edd6e1c
(cherry picked from commit 7567c4ac50508c2bcd38b37fc48b299912a34cf5)
Change-Id: I78024c0e25d812639d1236faa59d383742ae2141
diff --git a/tests/net/java/android/net/IpMemoryStoreTest.java b/tests/net/java/android/net/IpMemoryStoreTest.java
index 8ff2de9..6e69b34 100644
--- a/tests/net/java/android/net/IpMemoryStoreTest.java
+++ b/tests/net/java/android/net/IpMemoryStoreTest.java
@@ -111,13 +111,12 @@
@Test
public void testNetworkAttributes() throws Exception {
- startIpMemoryStore(true);
+ startIpMemoryStore(true /* supplyService */);
final String l2Key = "fakeKey";
mStore.storeNetworkAttributes(l2Key, TEST_NETWORK_ATTRIBUTES,
- status -> {
- assertTrue("Store not successful : " + status.resultCode, status.isSuccess());
- });
+ status -> assertTrue("Store not successful : " + status.resultCode,
+ status.isSuccess()));
verify(mMockService, times(1)).storeNetworkAttributes(eq(l2Key),
mNapCaptor.capture(), any());
assertEquals(TEST_NETWORK_ATTRIBUTES, new NetworkAttributes(mNapCaptor.getValue()));
@@ -135,7 +134,7 @@
@Test
public void testPrivateData() throws RemoteException {
- startIpMemoryStore(true);
+ startIpMemoryStore(true /* supplyService */);
final Blob b = new Blob();
b.data = TEST_BLOB_DATA;
final String l2Key = "fakeKey";
@@ -162,7 +161,7 @@
@Test
public void testFindL2Key()
throws UnknownHostException, RemoteException, Exception {
- startIpMemoryStore(true);
+ startIpMemoryStore(true /* supplyService */);
final String l2Key = "fakeKey";
mStore.findL2Key(TEST_NETWORK_ATTRIBUTES,
@@ -177,7 +176,7 @@
@Test
public void testIsSameNetwork() throws UnknownHostException, RemoteException {
- startIpMemoryStore(true);
+ startIpMemoryStore(true /* supplyService */);
final String l2Key1 = "fakeKey1";
final String l2Key2 = "fakeKey2";
@@ -193,7 +192,7 @@
@Test
public void testEnqueuedIpMsRequests() throws Exception {
- startIpMemoryStore(false);
+ startIpMemoryStore(false /* supplyService */);
final Blob b = new Blob();
b.data = TEST_BLOB_DATA;
@@ -201,9 +200,8 @@
// enqueue multiple ipms requests
mStore.storeNetworkAttributes(l2Key, TEST_NETWORK_ATTRIBUTES,
- status -> {
- assertTrue("Store not successful : " + status.resultCode, status.isSuccess());
- });
+ status -> assertTrue("Store not successful : " + status.resultCode,
+ status.isSuccess()));
mStore.retrieveNetworkAttributes(l2Key,
(status, key, attr) -> {
assertTrue("Retrieve network attributes not successful : "
@@ -212,9 +210,8 @@
assertEquals(TEST_NETWORK_ATTRIBUTES, attr);
});
mStore.storeBlob(l2Key, TEST_CLIENT_ID, TEST_DATA_NAME, b,
- status -> {
- assertTrue("Store not successful : " + status.resultCode, status.isSuccess());
- });
+ status -> assertTrue("Store not successful : " + status.resultCode,
+ status.isSuccess()));
mStore.retrieveBlob(l2Key, TEST_CLIENT_ID, TEST_OTHER_DATA_NAME,
(status, key, name, data) -> {
assertTrue("Retrieve blob status not successful : " + status.resultCode,
@@ -240,7 +237,7 @@
@Test
public void testEnqueuedIpMsRequestsWithException() throws Exception {
- startIpMemoryStore(true);
+ startIpMemoryStore(true /* supplyService */);
doThrow(RemoteException.class).when(mMockService).retrieveNetworkAttributes(any(), any());
final Blob b = new Blob();
@@ -249,9 +246,8 @@
// enqueue multiple ipms requests
mStore.storeNetworkAttributes(l2Key, TEST_NETWORK_ATTRIBUTES,
- status -> {
- assertTrue("Store not successful : " + status.resultCode, status.isSuccess());
- });
+ status -> assertTrue("Store not successful : " + status.resultCode,
+ status.isSuccess()));
mStore.retrieveNetworkAttributes(l2Key,
(status, key, attr) -> {
assertTrue("Retrieve network attributes not successful : "
@@ -260,9 +256,8 @@
assertEquals(TEST_NETWORK_ATTRIBUTES, attr);
});
mStore.storeBlob(l2Key, TEST_CLIENT_ID, TEST_DATA_NAME, b,
- status -> {
- assertTrue("Store not successful : " + status.resultCode, status.isSuccess());
- });
+ status -> assertTrue("Store not successful : " + status.resultCode,
+ status.isSuccess()));
mStore.retrieveBlob(l2Key, TEST_CLIENT_ID, TEST_OTHER_DATA_NAME,
(status, key, name, data) -> {
assertTrue("Retrieve blob status not successful : " + status.resultCode,
@@ -286,7 +281,7 @@
@Test
public void testEnqueuedIpMsRequestsCallbackFunctionWithException() throws Exception {
- startIpMemoryStore(true);
+ startIpMemoryStore(true /* supplyService */);
final Blob b = new Blob();
b.data = TEST_BLOB_DATA;
@@ -294,9 +289,8 @@
// enqueue multiple ipms requests
mStore.storeNetworkAttributes(l2Key, TEST_NETWORK_ATTRIBUTES,
- status -> {
- assertTrue("Store not successful : " + status.resultCode, status.isSuccess());
- });
+ status -> assertTrue("Store not successful : " + status.resultCode,
+ status.isSuccess()));
mStore.retrieveNetworkAttributes(l2Key,
(status, key, attr) -> {
throw new RuntimeException("retrieveNetworkAttributes test");
@@ -320,6 +314,7 @@
inOrder.verify(mMockService).storeNetworkAttributes(eq(l2Key), mNapCaptor.capture(),
any());
+ inOrder.verify(mMockService).retrieveNetworkAttributes(eq(l2Key), any());
inOrder.verify(mMockService).storeBlob(eq(l2Key), eq(TEST_CLIENT_ID), eq(TEST_DATA_NAME),
eq(b), any());
inOrder.verify(mMockService).retrieveBlob(eq(l2Key), eq(TEST_CLIENT_ID),