summaryrefslogtreecommitdiffstats
path: root/auth/auth-locate/src/test/java
diff options
context:
space:
mode:
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());