summaryrefslogtreecommitdiffstats
path: root/auth/auth-locate/src/test
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-09-07 12:21:34 -0500
committerInstrumental <jonathan.gathman@att.com>2018-09-07 12:22:50 -0500
commit4b5a7d721d994a49057e9bfb403c7bff1b376660 (patch)
treea36d03227b63a3e60346d6c3ca87b061087dae85 /auth/auth-locate/src/test
parent824dc7b5fc0e1ccdf7f460479aff344727f0f01e (diff)
Mass removal of all Tabs (Style Warnings)
Issue-ID: AAF-473 Change-Id: Iaf0ef8120882937959bb0065f2f6ba74a021940f Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-locate/src/test')
-rw-r--r--auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/JU_BasicAuthCodeTest.java96
-rw-r--r--auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/mapper/JU_Mapper_1_0Test.java46
-rw-r--r--auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java132
3 files changed, 137 insertions, 137 deletions
diff --git a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/JU_BasicAuthCodeTest.java b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/JU_BasicAuthCodeTest.java
index eea60eb0..cdae121a 100644
--- a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/JU_BasicAuthCodeTest.java
+++ b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/JU_BasicAuthCodeTest.java
@@ -42,74 +42,74 @@ import org.onap.aaf.misc.env.LogTarget;
public class JU_BasicAuthCodeTest {
- @Mock
- AAFAuthn authn;
+ @Mock
+ AAFAuthn authn;
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
- AuthzTrans trans;
+ @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+ AuthzTrans trans;
- @Mock
- HttpServletRequest req;
+ @Mock
+ HttpServletRequest req;
- @Mock
- HttpServletResponse resp;
+ @Mock
+ HttpServletResponse resp;
- @Mock
- LogTarget error;
+ @Mock
+ LogTarget error;
- @Mock
- LocateFacade facade;
+ @Mock
+ LocateFacade facade;
- @Mock
- BasicPrincipal basicPrincipal;
- @Mock
- X509Principal x509Principal;
+ @Mock
+ BasicPrincipal basicPrincipal;
+ @Mock
+ X509Principal x509Principal;
- @Before
- public void setUp() throws Exception {
- initMocks(this);
- }
+ @Before
+ public void setUp() throws Exception {
+ initMocks(this);
+ }
- @Test
- public void testWithNullUserPrincipal() throws Exception {
- BasicAuthCode basicAuthCode = new BasicAuthCode(authn, facade);
- LocateCode locateCode = basicAuthCode.clone(facade, false);
+ @Test
+ public void testWithNullUserPrincipal() throws Exception {
+ BasicAuthCode basicAuthCode = new BasicAuthCode(authn, facade);
+ LocateCode locateCode = basicAuthCode.clone(facade, false);
- assertEquals(locateCode.desc(), basicAuthCode.desc());
+ assertEquals(locateCode.desc(), basicAuthCode.desc());
- when(trans.getUserPrincipal()).thenReturn(null);
- when(trans.error()).thenReturn(error);
+ when(trans.getUserPrincipal()).thenReturn(null);
+ when(trans.error()).thenReturn(error);
- basicAuthCode.handle(trans, req, resp);
- }
+ basicAuthCode.handle(trans, req, resp);
+ }
- @Test
- public void testWithBasicUserPrincipal() throws Exception {
- BasicAuthCode basicAuthCode = new BasicAuthCode(authn, facade);
- LocateCode locateCode = basicAuthCode.clone(facade, false);
+ @Test
+ public void testWithBasicUserPrincipal() throws Exception {
+ BasicAuthCode basicAuthCode = new BasicAuthCode(authn, facade);
+ LocateCode locateCode = basicAuthCode.clone(facade, false);
- assertEquals(locateCode.desc(), basicAuthCode.desc());
+ assertEquals(locateCode.desc(), basicAuthCode.desc());
- when(trans.getUserPrincipal()).thenReturn(basicPrincipal);
+ when(trans.getUserPrincipal()).thenReturn(basicPrincipal);
- basicAuthCode.handle(trans, req, resp);
+ basicAuthCode.handle(trans, req, resp);
- verify(resp).setStatus(HttpStatus.OK_200);
- }
+ verify(resp).setStatus(HttpStatus.OK_200);
+ }
- @Test
- public void testWithX509UserPrincipal() throws Exception {
- BasicAuthCode basicAuthCode = new BasicAuthCode(authn, facade);
- LocateCode locateCode = basicAuthCode.clone(facade, false);
+ @Test
+ public void testWithX509UserPrincipal() throws Exception {
+ BasicAuthCode basicAuthCode = new BasicAuthCode(authn, facade);
+ LocateCode locateCode = basicAuthCode.clone(facade, false);
- assertEquals(locateCode.desc(), basicAuthCode.desc());
+ assertEquals(locateCode.desc(), basicAuthCode.desc());
- when(trans.getUserPrincipal()).thenReturn(x509Principal);
- when(req.getHeader("Authorization")).thenReturn("Basic 76//76");
+ when(trans.getUserPrincipal()).thenReturn(x509Principal);
+ when(req.getHeader("Authorization")).thenReturn("Basic 76//76");
- basicAuthCode.handle(trans, req, resp);
+ basicAuthCode.handle(trans, req, resp);
- verify(resp).setStatus(HttpStatus.FORBIDDEN_403);
- }
+ verify(resp).setStatus(HttpStatus.FORBIDDEN_403);
+ }
}
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 26bea940..5422117c 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
@@ -35,31 +35,31 @@ import locate_local.v1_0.Out;
public class JU_Mapper_1_0Test {
- @Before
- public void setUp() throws Exception {
+ @Before
+ public void setUp() throws Exception {
- }
+ }
- @Test
- public void testGetClasses() {
- 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));
- assertEquals(Void.class, mapper.getClass(API.VOID));
- assertEquals(Endpoints.class, mapper.getClass(API.ENDPOINTS));
- assertEquals(MgmtEndpoints.class, mapper.getClass(API.MGMT_ENDPOINTS));
- }
+ @Test
+ public void testGetClasses() {
+ 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));
+ assertEquals(Void.class, mapper.getClass(API.VOID));
+ assertEquals(Endpoints.class, mapper.getClass(API.ENDPOINTS));
+ assertEquals(MgmtEndpoints.class, mapper.getClass(API.MGMT_ENDPOINTS));
+ }
- @Test
- public void testNewInstance() {
- 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);
- assertTrue(mapper.newInstance(API.ENDPOINTS) instanceof Endpoints);
- assertTrue(mapper.newInstance(API.MGMT_ENDPOINTS) instanceof MgmtEndpoints);
- assertEquals(null, mapper.newInstance(API.VOID));
- }
+ @Test
+ public void testNewInstance() {
+ 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);
+ assertTrue(mapper.newInstance(API.ENDPOINTS) instanceof Endpoints);
+ assertTrue(mapper.newInstance(API.MGMT_ENDPOINTS) instanceof MgmtEndpoints);
+ assertEquals(null, mapper.newInstance(API.VOID));
+ }
}
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 c66de60b..e3a74720 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
@@ -44,71 +44,71 @@ 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;
- @Mock
- private Result<List<Data>> result;
- @Mock
- private Result endPointResult;
- @Mock
- private MgmtEndpoints meps;
- @Mock
- private MgmtEndpoint mgmtEndPoint;
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @Test
- public void test() throws APIException {
- LocateServiceImplExtension locateServiceImpl = new LocateServiceImplExtension(trans, aaf_locate, mapper);
- locateServiceImpl.set(locateDAO);
-
- assertEquals(mapper, locateServiceImpl.mapper());
-
- when(locateDAO.readByName(trans, "http")).thenReturn(result);
- when(mapper.endpoints(result, "1.0", "other")).thenReturn(endPointResult);
-
- Result output = locateServiceImpl.getEndPoints(trans, "http", "1.0", "other");
-
- assertEquals(endPointResult, output);
-
- List<MgmtEndpoint> mgmtEndPoints = new ArrayList<>();
- mgmtEndPoints.add(mgmtEndPoint);
-
- when(mgmtEndPoint.getName()).thenReturn("http.Endpoint1");
- when(mgmtEndPoint.getHostname()).thenReturn("HOST1");
- when(mgmtEndPoint.getPort()).thenReturn(9090);
- when(mgmtEndPoint.getProtocol()).thenReturn("HTTP");
-
- when(meps.getMgmtEndpoint()).thenReturn(mgmtEndPoints);
- output = locateServiceImpl.putMgmtEndPoints(trans, meps);
-
- assertEquals(output.toString(), Result.ok().toString());
-
- when(trans.fish(any())).thenReturn(true);
- Data data = new LocateDAO.Data();
- when(mapper.locateData(mgmtEndPoint)).thenReturn(data);
- output = locateServiceImpl.removeMgmtEndPoints(trans, meps);
-
- assertEquals(output.toString(), Result.ok().toString());
- }
+ // 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;
+ @Mock
+ private Result<List<Data>> result;
+ @Mock
+ private Result endPointResult;
+ @Mock
+ private MgmtEndpoints meps;
+ @Mock
+ private MgmtEndpoint mgmtEndPoint;
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Test
+ public void test() throws APIException {
+ LocateServiceImplExtension locateServiceImpl = new LocateServiceImplExtension(trans, aaf_locate, mapper);
+ locateServiceImpl.set(locateDAO);
+
+ assertEquals(mapper, locateServiceImpl.mapper());
+
+ when(locateDAO.readByName(trans, "http")).thenReturn(result);
+ when(mapper.endpoints(result, "1.0", "other")).thenReturn(endPointResult);
+
+ Result output = locateServiceImpl.getEndPoints(trans, "http", "1.0", "other");
+
+ assertEquals(endPointResult, output);
+
+ List<MgmtEndpoint> mgmtEndPoints = new ArrayList<>();
+ mgmtEndPoints.add(mgmtEndPoint);
+
+ when(mgmtEndPoint.getName()).thenReturn("http.Endpoint1");
+ when(mgmtEndPoint.getHostname()).thenReturn("HOST1");
+ when(mgmtEndPoint.getPort()).thenReturn(9090);
+ when(mgmtEndPoint.getProtocol()).thenReturn("HTTP");
+
+ when(meps.getMgmtEndpoint()).thenReturn(mgmtEndPoints);
+ output = locateServiceImpl.putMgmtEndPoints(trans, meps);
+
+ assertEquals(output.toString(), Result.ok().toString());
+
+ when(trans.fish(any())).thenReturn(true);
+ Data data = new LocateDAO.Data();
+ when(mapper.locateData(mgmtEndPoint)).thenReturn(data);
+ output = locateServiceImpl.removeMgmtEndPoints(trans, meps);
+
+ assertEquals(output.toString(), Result.ok().toString());
+ }
}