summaryrefslogtreecommitdiffstats
path: root/auth/auth-locate/src/test/java
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-06-26 09:11:08 -0500
committerInstrumental <jonathan.gathman@att.com>2018-06-26 09:47:57 -0500
commit5f1a6a0ab09ea3fa4199a8d413af75d4378e2a8e (patch)
tree709b3c564f602f715fcf20f281aa21a7e0ee57e3 /auth/auth-locate/src/test/java
parent732344f175150fed87e0140ad75152d325364c8b (diff)
Initial Interface for remote Configuration
Issue-ID: AAF-378 Change-Id: I320b0c23ece63199a49a5d8b1706868d2c4e5355 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-locate/src/test/java')
-rw-r--r--auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/mapper/JU_Mapper_1_0Test.java4
-rw-r--r--auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java16
2 files changed, 17 insertions, 3 deletions
diff --git a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/mapper/JU_Mapper_1_0Test.java b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/mapper/JU_Mapper_1_0Test.java
index 93b39b2d..26bea940 100644
--- a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/mapper/JU_Mapper_1_0Test.java
+++ b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/mapper/JU_Mapper_1_0Test.java
@@ -42,7 +42,7 @@ public class JU_Mapper_1_0Test {
@Test
public void testGetClasses() {
- Mapper_1_0 mapper = new Mapper_1_0();
+ Mapper_1_1 mapper = new Mapper_1_1();
assertEquals(InRequest.class, mapper.getClass(API.IN_REQ));
assertEquals(Out.class, mapper.getClass(API.OUT));
assertEquals(Error.class, mapper.getClass(API.ERROR));
@@ -53,7 +53,7 @@ public class JU_Mapper_1_0Test {
@Test
public void testNewInstance() {
- Mapper_1_0 mapper = new Mapper_1_0();
+ Mapper_1_1 mapper = new Mapper_1_1();
assertTrue(mapper.newInstance(API.IN_REQ) instanceof InRequest);
assertTrue(mapper.newInstance(API.OUT) instanceof Out);
assertTrue(mapper.newInstance(API.ERROR) instanceof Error);
diff --git a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java
index d9200d76..c79e9cbd 100644
--- a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java
+++ b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java
@@ -35,6 +35,7 @@ import org.onap.aaf.auth.dao.cass.LocateDAO;
import org.onap.aaf.auth.dao.cass.LocateDAO.Data;
import org.onap.aaf.auth.env.AuthzTrans;
import org.onap.aaf.auth.layer.Result;
+import org.onap.aaf.auth.locate.AAF_Locate;
import org.onap.aaf.auth.locate.mapper.Mapper;
import org.onap.aaf.misc.env.APIException;
@@ -43,9 +44,21 @@ import locate.v1_0.MgmtEndpoints;
public class JU_LocateServiceImplTest {
+ // Extend, because I don't want a "setter" in the original. Compromised with a protected...
+ private final class LocateServiceImplExtension extends LocateServiceImpl {
+ private LocateServiceImplExtension(AuthzTrans trans, AAF_Locate locate, Mapper mapper) throws APIException {
+ super(trans, locate, mapper);
+ }
+ public void set(LocateDAO ld) {
+ locateDAO=ld;
+ }
+ }
+
@Mock
private AuthzTrans trans;
@Mock
+ private AAF_Locate aaf_locate;
+ @Mock
private LocateDAO locateDAO;
@Mock
private Mapper mapper;
@@ -65,7 +78,8 @@ public class JU_LocateServiceImplTest {
@Test
public void test() throws APIException {
- LocateServiceImpl locateServiceImpl = new LocateServiceImpl(trans, locateDAO, mapper);
+ LocateServiceImplExtension locateServiceImpl = new LocateServiceImplExtension(trans, aaf_locate, mapper);
+ locateServiceImpl.set(locateDAO);
assertEquals(mapper, locateServiceImpl.mapper());