diff options
Diffstat (limited to 'auth')
6 files changed, 18 insertions, 46 deletions
diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java index af84d408..bc590695 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Create.java @@ -21,11 +21,7 @@ ******************************************************************************/ package org.onap.aaf.auth.cmd.test.ns; -import org.junit.Assert; -import org.junit.Before; - import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -34,21 +30,20 @@ import java.net.HttpURLConnection; import java.net.URI; import java.net.URISyntaxException; -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import org.onap.aaf.auth.cmd.AAFcli; import org.onap.aaf.auth.cmd.ns.Create; import org.onap.aaf.auth.cmd.ns.NS; -import org.onap.aaf.auth.cmd.test.JU_AAFCli; import org.onap.aaf.auth.env.AuthzEnv; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.Locator; +import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.LocatorException; import org.onap.aaf.cadi.PropAccess; import org.onap.aaf.cadi.SecuritySetter; -import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.http.HMangr; import org.onap.aaf.cadi.http.HRcli; import org.onap.aaf.misc.env.APIException; diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java index 332c45c5..ee877a4b 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Delete.java @@ -21,11 +21,7 @@ ******************************************************************************/ package org.onap.aaf.auth.cmd.test.ns; -import org.junit.Assert; -import org.junit.Before; - import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -36,21 +32,19 @@ import java.net.URI; import java.net.URISyntaxException; import java.security.GeneralSecurityException; -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Test; import org.onap.aaf.auth.cmd.AAFcli; import org.onap.aaf.auth.cmd.ns.Delete; import org.onap.aaf.auth.cmd.ns.NS; -import org.onap.aaf.auth.cmd.test.JU_AAFCli; import org.onap.aaf.auth.env.AuthzEnv; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.Locator; +import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.LocatorException; import org.onap.aaf.cadi.PropAccess; import org.onap.aaf.cadi.SecuritySetter; -import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.http.HMangr; -import org.onap.aaf.cadi.http.HRcli; import org.onap.aaf.misc.env.APIException; public class JU_Delete { diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java index d7b00220..c0efec00 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_Describe.java @@ -21,39 +21,29 @@ ******************************************************************************/ package org.onap.aaf.auth.cmd.test.ns; -import org.junit.Assert; -import org.junit.Before; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.CALLS_REAL_METHODS; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.Writer; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; import java.net.HttpURLConnection; import java.net.URI; import java.net.URISyntaxException; -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import org.onap.aaf.auth.cmd.AAFcli; import org.onap.aaf.auth.cmd.ns.Describe; import org.onap.aaf.auth.cmd.ns.NS; -import org.onap.aaf.auth.cmd.test.JU_AAFCli; import org.onap.aaf.auth.env.AuthzEnv; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.Locator; +import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.LocatorException; import org.onap.aaf.cadi.PropAccess; import org.onap.aaf.cadi.SecuritySetter; -import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.http.HMangr; -import org.onap.aaf.cadi.http.HRcli; import org.onap.aaf.misc.env.APIException; @RunWith(MockitoJUnitRunner.class) diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java index ef50f92b..61236eee 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_Describe.java @@ -21,11 +21,7 @@ ******************************************************************************/ package org.onap.aaf.auth.cmd.test.role; -import org.junit.Assert; -import org.junit.Before; - import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -34,23 +30,21 @@ import java.net.HttpURLConnection; import java.net.URI; import java.net.URISyntaxException; -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import org.onap.aaf.auth.cmd.AAFcli; import org.onap.aaf.auth.cmd.role.Describe; import org.onap.aaf.auth.cmd.role.Role; -import org.onap.aaf.auth.cmd.test.JU_AAFCli; import org.onap.aaf.auth.env.AuthzEnv; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.Locator; +import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.LocatorException; import org.onap.aaf.cadi.PropAccess; import org.onap.aaf.cadi.SecuritySetter; -import org.onap.aaf.cadi.Locator.Item; import org.onap.aaf.cadi.http.HMangr; -import org.onap.aaf.cadi.http.HRcli; import org.onap.aaf.misc.env.APIException; @RunWith(MockitoJUnitRunner.class) diff --git a/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/API_Hello.java b/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/API_Hello.java index 030073a7..97727abd 100644 --- a/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/API_Hello.java +++ b/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/API_Hello.java @@ -121,7 +121,7 @@ public class API_Hello { //////////////// // READ/GET //////////////// - oauthHello.route(oauthHello.env,HttpMethods.GET,"/resthello/:id/:perm*",new HttpCode<AuthzTrans, AAF_Hello>(oauthHello,"REST Hello Read") { + oauthHello.route(oauthHello.env,HttpMethods.GET,"/resthello/:id",new HttpCode<AuthzTrans, AAF_Hello>(oauthHello,"REST Hello Read") { @Override public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception { resp.setStatus(200 /* OK */); diff --git a/auth/docker/agent.sh b/auth/docker/agent.sh index eb0bf3aa..4aba092c 100644 --- a/auth/docker/agent.sh +++ b/auth/docker/agent.sh @@ -6,12 +6,20 @@ CADI_VERSION=2.1.2-SNAPSHOT if [ ! -e aaf.props ]; then > ./aaf.props fi -for V in VERSION AAF_FQDN DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do + +. ./aaf.props + +for V in VERSION AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do if [ "$(grep $V ./aaf.props)" = "" ]; then unset DEF case $V in AAF_FQDN) PROMPT="AAF's FQDN";; DEPLOY_FQI) PROMPT="Deployer's FQI";; + AAF_FQDN_IP) + # Need AAF_FQDN's IP, because not might not be available in mini-container + PROMPT="AAF FQDN IP" + DEF=$(host $AAF_FQDN | grep "has address" | tail -1 | cut -f 4 -d ' ') + ;; APP_FQI) PROMPT="App's FQI";; APP_FQDN) PROMPT="App's Root FQDN";; VOLUME) PROMPT="APP's AAF Configuration Volume";; @@ -39,15 +47,6 @@ for V in VERSION AAF_FQDN DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LON done . ./aaf.props -# Need AAF_FQDN's IP, because not might not be available in mini-container -if [ "$AAF_FQDN_IP" = "" ]; then - AAF_FQDN_IP=$(host $AAF_FQDN | grep "has address" | tail -1 | cut -f 4 -d ' ') - if [ "$AAF_FQDN_IP" = "" ]; then - read -p "IP of $AAF_FQDN: " AAF_FQDN_IP - echo "AAF_FQDN_IP=$AAF_FQDN_IP" >> ./aaf.props - fi -fi - # Make sure Container Volume exists if [ "$(docker volume ls | grep ${VOLUME})" = "" ]; then echo -n "Creating Volume: " |