diff options
author | Instrumental <jonathan.gathman@att.com> | 2018-07-22 07:49:16 -0500 |
---|---|---|
committer | Instrumental <jonathan.gathman@att.com> | 2018-07-22 07:49:20 -0500 |
commit | cf52d77279f8d5a70429d45abad0ef3d1135070c (patch) | |
tree | f084fd660d3e201abc853df8f17542a044120070 /auth/auth-cmd/src | |
parent | 65c40b3bffb78a1a77d82fc74bbf633a6d0d906f (diff) |
Finish RESTful Client API
Issue-ID: AAF-361
Change-Id: I999cb419a79c5995baf3757fdbbe047528901597
Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-cmd/src')
5 files changed, 21 insertions, 17 deletions
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/HMangrStub.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/HMangrStub.java index 7ceb1233..c1b87540 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/HMangrStub.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/HMangrStub.java @@ -49,6 +49,10 @@ public class HMangrStub extends HMangr { return null; } @Override public<RET> RET oneOf(SecuritySetter<HttpURLConnection> ss, Retryable<RET> retryable, boolean notify, String host) { + try { + return retryable.code(clientMock); + } catch (Exception e) { + } return null; } } diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Create.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Create.java index 1fb27470..41295c79 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Create.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Create.java @@ -60,7 +60,7 @@ public class JU_Create { @Mock private Locator<URI> locMock; @Mock private Writer wrtMock; @Mock private Rcli<HttpURLConnection> clientMock; - @Mock private Future<Object> futureMock; + @Mock private Future<String> futureMock; private static Create create; @@ -74,9 +74,9 @@ public class JU_Create { public void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { MockitoAnnotations.initMocks(this); - when(clientMock.create(any(), any(), any())).thenReturn(futureMock); - when(clientMock.delete(any(), any(), any())).thenReturn(futureMock); - when(clientMock.update(any(), any(), any())).thenReturn(futureMock); + when(clientMock.create(any(), any(), any(String.class))).thenReturn(futureMock); + when(clientMock.delete(any(), any(), any(String.class))).thenReturn(futureMock); + when(clientMock.update(any(), any(), any(String.class))).thenReturn(futureMock); hman = new HMangrStub(access, locMock, clientMock); access = new PropAccess(new PrintStream(new ByteArrayOutputStream()), new String[0]); diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Delete.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Delete.java index 4fd7892a..19cacedb 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Delete.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Delete.java @@ -24,7 +24,7 @@ package org.onap.aaf.auth.cmd.test.perm; import static org.mockito.Matchers.any; import static org.mockito.Mockito.when; - +import org.hamcrest.core.AnyOf; import org.junit.Before; import org.onap.aaf.auth.cmd.test.HMangrStub; @@ -62,7 +62,7 @@ public class JU_Delete { @Mock private Locator<URI> locMock; @Mock private Writer wrtMock; @Mock private Rcli<HttpURLConnection> clientMock; - @Mock private Future<Object> futureMock; + @Mock private Future<String> futureMock; private static Delete del; @@ -75,9 +75,9 @@ public class JU_Delete { public void setUp() throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { MockitoAnnotations.initMocks(this); - when(clientMock.create(any(), any(), any())).thenReturn(futureMock); - when(clientMock.delete(any(), any(), any())).thenReturn(futureMock); - when(clientMock.update(any(), any(), any())).thenReturn(futureMock); + when(clientMock.create(any(), any(), any(String.class))).thenReturn(futureMock); + when(clientMock.delete(any(), any(), any(String.class))).thenReturn(futureMock); + when(clientMock.update(any(), any(), any(String.class))).thenReturn(futureMock); hman = new HMangrStub(access, locMock, clientMock); access = new PropAccess(new PrintStream(new ByteArrayOutputStream()), new String[0]); diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Describe.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Describe.java index 224b5c75..9a5fc734 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Describe.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Describe.java @@ -61,7 +61,7 @@ public class JU_Describe { @Mock private Locator<URI> locMock; @Mock private Writer wrtMock; @Mock private Rcli<HttpURLConnection> clientMock; - @Mock private Future<Object> futureMock; + @Mock private Future<String> futureMock; private PropAccess access; private HMangrStub hman; @@ -74,9 +74,9 @@ public class JU_Describe { public void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { MockitoAnnotations.initMocks(this); - when(clientMock.create(any(), any(), any())).thenReturn(futureMock); - when(clientMock.delete(any(), any(), any())).thenReturn(futureMock); - when(clientMock.update(any(), any(), any())).thenReturn(futureMock); + when(clientMock.create(any(), any(), any(String.class))).thenReturn(futureMock); + when(clientMock.delete(any(), any(), any(String.class))).thenReturn(futureMock); + when(clientMock.update(any(), any(), any(String.class))).thenReturn(futureMock); hman = new HMangrStub(access, locMock, clientMock); access = new PropAccess(new PrintStream(new ByteArrayOutputStream()), new String[0]); diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Grant.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Grant.java index 17280c64..975b83d2 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Grant.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/perm/JU_Grant.java @@ -63,7 +63,7 @@ public class JU_Grant { @Mock private Locator<URI> locMock; @Mock private Writer wrtMock; @Mock private Rcli<HttpURLConnection> clientMock; - @Mock private Future<Object> futureMock; + @Mock private Future<String> futureMock; private PropAccess access; private HMangrStub hman; @@ -74,9 +74,9 @@ public class JU_Grant { public void setUp () throws NoSuchFieldException, SecurityException, Exception, IllegalAccessException { MockitoAnnotations.initMocks(this); - when(clientMock.create(any(), any(), any())).thenReturn(futureMock); - when(clientMock.delete(any(), any(), any())).thenReturn(futureMock); - when(clientMock.update(any(), any(), any())).thenReturn(futureMock); + when(clientMock.create(any(), any(), any(String.class))).thenReturn(futureMock); + when(clientMock.delete(any(), any(), any(String.class))).thenReturn(futureMock); + when(clientMock.update(any(), any(), any(String.class))).thenReturn(futureMock); hman = new HMangrStub(access, locMock, clientMock); access = new PropAccess(new PrintStream(new ByteArrayOutputStream()), new String[0]); |