From 762dabc6f9577b5b1a8211dddf38ce34295f22a4 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Tue, 6 Nov 2018 11:04:35 -0600 Subject: API Version backward compat Issue-ID: AAF-610 Change-Id: I574270119af8836e30ed25be27ae702497aa8fa8 Signed-off-by: Instrumental --- .../java/org/onap/aaf/auth/oauth/service/JSONPermLoaderFactory.java | 2 +- .../onap/aaf/auth/oauth/service/JU_JSONPermLoaderFactoryTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'auth/auth-oauth/src') diff --git a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/service/JSONPermLoaderFactory.java b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/service/JSONPermLoaderFactory.java index 8bceb2ab..e3179aea 100644 --- a/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/service/JSONPermLoaderFactory.java +++ b/auth/auth-oauth/src/main/java/org/onap/aaf/auth/oauth/service/JSONPermLoaderFactory.java @@ -47,7 +47,7 @@ public class JSONPermLoaderFactory { public static JSONPermLoader remote(final AAFCon aafcon, final int timeout) { return new JSONPermLoader() { public Result loadJSONPerms(AuthzTrans trans, String user, Set scopes) throws APIException, CadiException { - Rcli c = aafcon.clientAs(Config.AAF_DEFAULT_VERSION,trans.getUserPrincipal()); + Rcli c = aafcon.clientAs(Config.AAF_DEFAULT_API_VERSION,trans.getUserPrincipal()); StringBuilder pathinfo = new StringBuilder("/authz/perms/user/"); pathinfo.append(user); pathinfo.append("?scopes="); diff --git a/auth/auth-oauth/src/test/java/org/onap/aaf/auth/oauth/service/JU_JSONPermLoaderFactoryTest.java b/auth/auth-oauth/src/test/java/org/onap/aaf/auth/oauth/service/JU_JSONPermLoaderFactoryTest.java index 529a6ae2..786b4282 100644 --- a/auth/auth-oauth/src/test/java/org/onap/aaf/auth/oauth/service/JU_JSONPermLoaderFactoryTest.java +++ b/auth/auth-oauth/src/test/java/org/onap/aaf/auth/oauth/service/JU_JSONPermLoaderFactoryTest.java @@ -84,7 +84,7 @@ public class JU_JSONPermLoaderFactoryTest { @Test public void testRemoteWithTimeOut() throws APIException, CadiException { when(trans.start("Call AAF Service", Env.REMOTE)).thenReturn(tt); - when(aafcon.clientAs(Config.AAF_DEFAULT_VERSION, trans.getUserPrincipal())).thenReturn(c); + when(aafcon.clientAs(Config.AAF_DEFAULT_API_VERSION, trans.getUserPrincipal())).thenReturn(c); when(c.read("/authz/perms/user/null?scopes=APPLICATION:HANDLER", "application/Perms+json;charset=utf-8;version=2.0")).thenReturn(fs); when(fs.get(0)).thenReturn(true); @@ -105,7 +105,7 @@ public class JU_JSONPermLoaderFactoryTest { @Test public void testRemoteWith404() throws APIException, CadiException { when(trans.start("Call AAF Service", Env.REMOTE)).thenReturn(tt); - when(aafcon.clientAs(Config.AAF_DEFAULT_VERSION, trans.getUserPrincipal())).thenReturn(c); + when(aafcon.clientAs(Config.AAF_DEFAULT_API_VERSION, trans.getUserPrincipal())).thenReturn(c); when(c.read("/authz/perms/user/null?scopes=APPLICATION:HANDLER", "application/Perms+json;charset=utf-8;version=2.0")).thenReturn(fs); when(fs.get(0)).thenReturn(false); @@ -127,7 +127,7 @@ public class JU_JSONPermLoaderFactoryTest { @Test public void testRemote() throws APIException, CadiException { when(trans.start("Call AAF Service", Env.REMOTE)).thenReturn(tt); - when(aafcon.clientAs(Config.AAF_DEFAULT_VERSION, trans.getUserPrincipal())).thenReturn(c); + when(aafcon.clientAs(Config.AAF_DEFAULT_API_VERSION, trans.getUserPrincipal())).thenReturn(c); when(c.read("/authz/perms/user/null?scopes=APPLICATION:HANDLER", "application/Perms+json;charset=utf-8;version=2.0")).thenReturn(fs); when(fs.get(0)).thenReturn(false); -- cgit 1.2.3-korg