From f5bb572dd89dea0d74e4e8ba17c7bf5b044c2dc4 Mon Sep 17 00:00:00 2001 From: "gabe.maurer" Date: Mon, 7 May 2018 10:10:21 -0500 Subject: Increased coverage authfs Issue-ID: AAF-240 Change-Id: I7a109dd5215566ca0b6d49c5112ffadab6e3f21e Signed-off-by: gabe.maurer --- .../test/java/org/onap/aaf/auth/test/JU_Batch.java | 92 ++++++++++++++++++++++ .../org/onap/aaf/auth/test/JU_BatchException.java | 59 ++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 auth/auth-batch/src/test/java/org/onap/aaf/auth/test/JU_Batch.java create mode 100644 auth/auth-batch/src/test/java/org/onap/aaf/auth/test/JU_BatchException.java (limited to 'auth/auth-batch') diff --git a/auth/auth-batch/src/test/java/org/onap/aaf/auth/test/JU_Batch.java b/auth/auth-batch/src/test/java/org/onap/aaf/auth/test/JU_Batch.java new file mode 100644 index 00000000..752b98b7 --- /dev/null +++ b/auth/auth-batch/src/test/java/org/onap/aaf/auth/test/JU_Batch.java @@ -0,0 +1,92 @@ +/** + * ============LICENSE_START==================================================== + * org.onap.aaf + * =========================================================================== + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * =========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END==================================================== + * + */ + +package org.onap.aaf.auth.test; + +import static org.junit.Assert.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.onap.aaf.auth.Batch; +import org.onap.aaf.auth.env.AuthzEnv; +import org.onap.aaf.auth.env.AuthzTrans; +import org.onap.aaf.auth.org.Organization; +import org.onap.aaf.auth.org.OrganizationException; +import org.onap.aaf.auth.org.OrganizationFactory; +import org.onap.aaf.cadi.client.Future; +import org.onap.aaf.cadi.client.Rcli; +import org.onap.aaf.cadi.config.Config; +import org.onap.aaf.misc.env.APIException; + +import static org.mockito.Mockito.*; + +import java.io.IOException; + +import org.junit.Test; + +public class JU_Batch { + + AuthzEnv env; + Batch batch; + + private class BatchStub extends Batch { + + protected BatchStub(AuthzEnv env) throws APIException, IOException, OrganizationException { + super(env); + // TODO Auto-generated constructor stub + } + + @Override + protected void run(AuthzTrans trans) { + // TODO Auto-generated method stub + + } + + @Override + protected void _close(AuthzTrans trans) { + // TODO Auto-generated method stub + + } + + } + + @Before + public void setUp() throws OrganizationException { + env = new AuthzEnv(); + env.access().setProperty(Config.CADI_LATITUDE, "38.550674"); + env.access().setProperty(Config.CADI_LONGITUDE, "-90.146942"); + env.setProperty("DRY_RUN", "test"); + env.setProperty("Organization.@aaf.com", "test"); + //env.setProperty("Organization.com.@aaf", "java.lang.Integer"); + env.setProperty("Organization.com.@aaf", "org.onap.aaf.auth.org.Organization"); + env.setProperty("CASS_ENV", "test"); + env.setProperty("test.VERSION", "test.VERSION"); + } + + @Test + public void testIsSpecial() throws APIException, IOException, OrganizationException { + //BatchStub bStub = new BatchStub(env); + //bStub.isSpecial("user"); + } + +} diff --git a/auth/auth-batch/src/test/java/org/onap/aaf/auth/test/JU_BatchException.java b/auth/auth-batch/src/test/java/org/onap/aaf/auth/test/JU_BatchException.java new file mode 100644 index 00000000..dad723b9 --- /dev/null +++ b/auth/auth-batch/src/test/java/org/onap/aaf/auth/test/JU_BatchException.java @@ -0,0 +1,59 @@ +/** + * ============LICENSE_START==================================================== + * org.onap.aaf + * =========================================================================== + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * =========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END==================================================== + * + */ + + +package org.onap.aaf.auth.test; + +import static org.junit.Assert.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.onap.aaf.auth.BatchException; + +import static org.mockito.Mockito.*; +import org.junit.Test; + +public class JU_BatchException { + + BatchException bExcept1; + BatchException bExcept2; + BatchException bExcept3; + BatchException bExcept4; + BatchException bExcept5; + Throwable throwable; + + @Before + public void setUp() { + throwable = new Throwable(); + } + + @Test + public void test() { + bExcept1 = new BatchException(); + bExcept2 = new BatchException("test"); + bExcept3 = new BatchException(throwable); + bExcept4 = new BatchException("test", throwable); + bExcept5 = new BatchException("test", throwable,true,true); + } + +} -- cgit 1.2.3-korg