summaryrefslogtreecommitdiffstats
path: root/authz-service/src/test/java/org
diff options
context:
space:
mode:
authorInstrumental <jcgmisc@stl.gathman.org>2018-03-26 14:09:21 -0700
committerInstrumental <jcgmisc@stl.gathman.org>2018-03-26 14:09:26 -0700
commit0ed473b17619d749bbdf56ad17199e71fb04c2be (patch)
tree190e4d83bffbc386eb7b8dd670f14809343dd664 /authz-service/src/test/java/org
parent10027f3cd15afd2c8ef341e5cd92de911e07965e (diff)
AT&T 2.0.19 Code drop, stage 5
Issue-ID: AAF-197 Change-Id: I81dd2a8fd8cd4d4771e390609909c86ac09b7dac Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'authz-service/src/test/java/org')
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectAAFLur.java66
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectAAFUserPass.java74
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectCertIdentity.java72
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/JU_AuthAPI.java75
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Api.java61
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Approval.java63
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Creds.java75
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Delegate.java57
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_History.java63
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Mgmt.java60
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_NS.java52
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Perms.java69
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Roles.java58
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_User.java58
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_UserRole.java54
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/mapper/JU_Mapper_2_0.java163
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/test/JU_Validator.java159
-rw-r--r--authz-service/src/test/java/org/onap/aaf/authz/service/validation/JU_Validator.java219
18 files changed, 0 insertions, 1498 deletions
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectAAFLur.java b/authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectAAFLur.java
deleted file mode 100644
index 166e92a0..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectAAFLur.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.cadi;
-
-import static org.junit.Assert.*;
-
-import java.security.Principal;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.cadi.DirectAAFLur;
-import org.onap.aaf.authz.env.AuthzEnv;
-import org.onap.aaf.dao.aaf.hl.Question;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-import org.onap.aaf.cadi.Permission;
-@RunWith(PowerMockRunner.class)
-public class JU_DirectAAFLur {
-
-public static AuthzEnv env;
-public static Question question;
-public DirectAAFLur directAAFLur;
-
-
-
- @Before
- public void setUp()
- {
- directAAFLur = new DirectAAFLur(env, question);
- }
-
- @Test
- public void testFish()
- {
-
- Principal bait = null;
- Permission pond=null;
- directAAFLur.fish(bait, pond);
-
- assertTrue(true);
-
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectAAFUserPass.java b/authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectAAFUserPass.java
deleted file mode 100644
index 5a0811ce..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectAAFUserPass.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.cadi;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import org.onap.aaf.cadi.CredVal.Type;
-
-import static org.mockito.Mockito.*;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.onap.aaf.authz.cadi.DirectAAFUserPass;
-import org.onap.aaf.authz.env.AuthzEnv;
-import org.onap.aaf.dao.aaf.hl.Question;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-
-@RunWith(PowerMockRunner.class)
-public class JU_DirectAAFUserPass {
-
-//public static AuthzEnv env;
-//public static Question question;
-public static String string;
-public DirectAAFUserPass directAAFUserPass;
-
-@Mock
-AuthzEnv env;
-Question question;
-String user;
-Type type;
-byte[] pass;
- @Before
- public void setUp() {
- directAAFUserPass = new DirectAAFUserPass(env, question, string);
- }
-
- @Test
- public void testvalidate(){
-
-// Boolean bolVal = directAAFUserPass.validate(user, type, pass);
- // assertEquals((bolVal==null),true);
-
- assertTrue(true);
-
- }
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectCertIdentity.java b/authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectCertIdentity.java
deleted file mode 100644
index b6f22b7d..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/cadi/JU_DirectCertIdentity.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.cadi;
-
-import static org.junit.Assert.*;
-
-import java.security.Principal;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.cadi.DirectCertIdentity;
-import org.onap.aaf.dao.aaf.cached.CachedCertDAO;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-public class JU_DirectCertIdentity {
-
- public DirectCertIdentity directCertIdentity;
-
- @Before
- public void setUp(){
- directCertIdentity = new DirectCertIdentity();
- }
-
-
- @Mock
- HttpServletRequest req;
- X509Certificate cert;
- byte[] _certBytes;
-
- @Test
- public void testidentity(){
-
- try {
- Principal p = directCertIdentity.identity(req, cert, _certBytes);
- assertEquals(( (p) == null),true);
-
- } catch (CertificateException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- //assertTrue(true);
-
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/JU_AuthAPI.java b/authz-service/src/test/java/org/onap/aaf/authz/service/JU_AuthAPI.java
deleted file mode 100644
index 364869c9..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/JU_AuthAPI.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service;
-
-import static org.junit.Assert.*;
-
-import java.util.Properties;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.aaf.authz.cadi.DirectAAFUserPass;
-import org.onap.aaf.authz.env.AuthzEnv;
-import org.onap.aaf.authz.facade.AuthzFacade_2_0;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.dao.aaf.hl.Question;
-
-public class JU_AuthAPI {
-
- public AuthAPI authAPI;
- AuthzEnv env;
- private static final String ORGANIZATION = "Organization.";
- private static final String DOMAIN = "openecomp.org";
-
- public Question question;
- private AuthzFacade_2_0 facade;
- private AuthzFacade_2_0 facade_XML;
- private DirectAAFUserPass directAAFUserPass;
- public Properties props;
- @Before
- public void setUp(){
- try {
- authAPI = new AuthAPI(env);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @Test
- public void testStartDME2(Properties props){
- try {
- authAPI.startDME2(props);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- //assertTrue(true);
-
- }
-
-
-
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Api.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Api.java
deleted file mode 100644
index f4158ce8..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Api.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_Api;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_Api {
- API_Api api_Api;
- @Mock
- AuthAPI authzAPI;
- AuthzFacade facade;
-
- @Before
- public void setUp(){
- //api_Api = new API_Api();
- }
-
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit()
- {
- try {
- api_Api.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- assertTrue(true);
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Approval.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Approval.java
deleted file mode 100644
index d3bd5de4..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Approval.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_Approval;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_Approval {
- API_Approval api_Approval;
-
- @Mock
- AuthAPI authzAPI;
- AuthzFacade facade;
-
- @Before
- public void setUp()
- {
-
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit() {
-
- try {
- api_Approval.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- //assertTrue(true);
- }
-
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Creds.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Creds.java
deleted file mode 100644
index d8ebc508..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Creds.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.cadi.DirectAAFUserPass;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_Creds;
-
-import org.onap.aaf.inno.env.Env;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_Creds {
-
-API_Creds api_Creds;
-@Mock
-AuthAPI authzAPI;
-AuthzFacade facade;
-Env env;
-DirectAAFUserPass directAAFUserPass;
- @Before
- public void setUp(){
-
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit(){
- try {
- api_Creds.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testTimeSensitiveInit(){
-
- try {
- api_Creds.timeSensitiveInit(env, authzAPI, facade, directAAFUserPass);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Delegate.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Delegate.java
deleted file mode 100644
index 2be9bbcc..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Delegate.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_Delegate;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_Delegate {
-API_Delegate api_Delegate;
-@Mock
-AuthAPI authzAPI;
-AuthzFacade facade;
- @Before
- public void setUp() {
-
-
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit(){
-
- try {
- api_Delegate.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_History.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_History.java
deleted file mode 100644
index 3f624bf9..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_History.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_History;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_History {
- API_History api_History;
-
- @Mock
- AuthAPI authzAPI;
- AuthzFacade facade;
-
- @Before
- public void setUp(){
-
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit(){
-
- try {
- api_History.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- assertTrue(true);
- }
-
-
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Mgmt.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Mgmt.java
deleted file mode 100644
index 9fc2eefe..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Mgmt.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_Mgmt;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_Mgmt {
- API_Mgmt api_Mgmt;
-
- @Mock
- AuthAPI authzAPI;
- AuthzFacade facade;
-
- @Before
- public void setUp(){
-
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit(){
-
- try {
- api_Mgmt.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_NS.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_NS.java
deleted file mode 100644
index 8509304e..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_NS.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_NS;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_NS {
- API_NS api_Ns;
- @Mock
- AuthAPI authzAPI;
- AuthzFacade facade;
-
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit(){
- try {
- api_Ns.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Perms.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Perms.java
deleted file mode 100644
index 15674f7b..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Perms.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_Perms;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_Perms {
- API_Perms api_Perms;
- @Mock
- AuthAPI authzAPI;
- AuthzFacade facade;
-
- @Before
- public void setUp(){
-
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit(){
- try {
- api_Perms.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testTimeSensitiveInit(){
- try {
- api_Perms.timeSensitiveInit(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Roles.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Roles.java
deleted file mode 100644
index 43cc8d50..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_Roles.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_Roles;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_Roles {
- API_Roles api_Roles;
- @Mock
- AuthAPI authzAPI;
- AuthzFacade facade;
-
-
- @Before
- public void setUp() {
- assertTrue(true);
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit(){
- try {
- api_Roles.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_User.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_User.java
deleted file mode 100644
index 29eee9f3..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_User.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_User;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_User {
- API_User api_User;
- @Mock
- AuthAPI authzAPI;
- AuthzFacade facade;
-
- @Before
- public void setUp() {
- //assertTrue(true);
- }
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit(){
- try {
- api_User.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_UserRole.java b/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_UserRole.java
deleted file mode 100644
index 8adcb647..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/api/JU_API_UserRole.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.onap.aaf.authz.facade.AuthzFacade;
-import org.onap.aaf.authz.service.AuthAPI;
-import org.onap.aaf.authz.service.api.API_UserRole;
-import org.powermock.modules.junit4.PowerMockRunner;
-@RunWith(PowerMockRunner.class)
-public class JU_API_UserRole {
- API_UserRole api_UserRole;
- @Mock
- AuthAPI authzAPI;
- AuthzFacade facade;
-
-
- @SuppressWarnings("static-access")
- @Test
- public void testInit(){
- try {
- api_UserRole.init(authzAPI, facade);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/mapper/JU_Mapper_2_0.java b/authz-service/src/test/java/org/onap/aaf/authz/service/mapper/JU_Mapper_2_0.java
deleted file mode 100644
index 90e14295..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/mapper/JU_Mapper_2_0.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.mapper;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class JU_Mapper_2_0 {
-
- @Test
- public void test() {
- assertTrue(true);
- }
-
- @Test
- public void testApprovals(){
- assertTrue(true);
- }
-
- @Test
- public void testCert(){
- assertTrue(true);
-
- }
-
- @Test
- public void testCred(){
- assertTrue(true);
-
- }
-
- @Test
- public void testDelegate(){
- assertTrue(true);
- }
-
- @Test
- public void testErrorFromMessage(){
- assertTrue(true);
-
- }
-
- @Test
- public void testFuture(){
- assertTrue(true);
- }
-
- @Test
- public void testGetClass(){
- assertTrue(true);
- }
-
- @Test
- public void testGetExpires(){
- assertTrue(true);
- }
-
- @Test
- public void testGetMarshal(){
- assertTrue(true);
-
- }
-
- @Test
- public void testHistory(){
- assertTrue(true);
- }
-
- @Test
- public void testKeys(){
- assertTrue(true);
-
- }
-
- @Test
- public void testNewInstance(){
- assertTrue(true);
- }
-
- @Test
- public void testNs(){
- assertTrue(true);
- }
-
- @Test
- public void testNss(){
- assertTrue(true);
- }
-
- @Test
- public void testPerm(){
- assertTrue(true);
- }
-
- @Test
- public void testPermFromRPRequest(){
- assertTrue(true);
- }
-
- @Test
- public void testPermKey(){
- assertTrue(true);
- }
-
- @Test
- public void testPerms(){
- assertTrue(true);
- }
-
- @Test
- public void testRole(){
- assertTrue(true);
- }
-
- @Test
- public void testRoleFromRPRequest(){
- assertTrue(true);
- }
-
- @Test
- public void testRoles(){
- assertTrue(true);
- }
-
- @Test
- public void testUserRole(){
- assertTrue(true);
- }
-
- @Test
- public void testUserRoles(){
- assertTrue(true);
- }
-
- @Test
- public void testUsers(){
- assertTrue(true);
- }
-
-
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/test/JU_Validator.java b/authz-service/src/test/java/org/onap/aaf/authz/service/test/JU_Validator.java
deleted file mode 100644
index 6c5cc000..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/test/JU_Validator.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.onap.aaf.authz.service.validation.Validator;
-
-public class JU_Validator {
-
-
- @Test
- public void test() {
- assertTrue(Validator.ACTION_CHARS.matcher("HowdyDoody").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("Howd?yDoody").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("_HowdyDoody").matches());
- assertTrue(Validator.INST_CHARS.matcher("HowdyDoody").matches());
- assertFalse(Validator.INST_CHARS.matcher("Howd?yDoody").matches());
- assertTrue(Validator.INST_CHARS.matcher("_HowdyDoody").matches());
-
- //
- assertTrue(Validator.ACTION_CHARS.matcher("*").matches());
- assertTrue(Validator.INST_CHARS.matcher("*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":*:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":*:*").matches());
-
- assertFalse(Validator.ACTION_CHARS.matcher(":hello").matches());
- assertTrue(Validator.INST_CHARS.matcher(":hello").matches());
- assertFalse(Validator.INST_CHARS.matcher("hello:").matches());
- assertFalse(Validator.INST_CHARS.matcher("hello:d").matches());
-
- assertFalse(Validator.ACTION_CHARS.matcher(":hello:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":hello:*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":hello:d*:*").matches());
- assertFalse(Validator.INST_CHARS.matcher(":hello:d*d:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":hello:d*:*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("HowdyDoody*").matches());
- assertFalse(Validator.INST_CHARS.matcher("Howdy*Doody").matches());
- assertTrue(Validator.INST_CHARS.matcher("HowdyDoody*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("*HowdyDoody").matches());
- assertFalse(Validator.INST_CHARS.matcher("*HowdyDoody").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":h*").matches());
- assertFalse(Validator.INST_CHARS.matcher(":h*h*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":h*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":h:h*:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":h:h*:*").matches());
- assertFalse(Validator.INST_CHARS.matcher(":h:h*h:*").matches());
- assertFalse(Validator.INST_CHARS.matcher(":h:h*h*:*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":h:*:*h").matches());
- assertFalse(Validator.INST_CHARS.matcher(":h:*:*h").matches());
- assertTrue(Validator.INST_CHARS.matcher(":com.test.*:ns:*").matches());
-
-
- assertFalse(Validator.ACTION_CHARS.matcher("1234+235gd").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("1234-235gd").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("1234-23_5gd").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("1234-235g,d").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("1234-235gd(Version12)").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("123#4-23@5g:d").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("123#4-23@5g:d").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("1234-23 5gd").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("1234-235gd ").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(" 1234-235gd").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(" ").matches());
-
- // Allow % and = (Needed for Escaping & Base64 usages) jg
- assertTrue(Validator.ACTION_CHARS.matcher("1234%235g=d").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":1234%235g=d").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234%235g=d").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d:%20==").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d:==%20:=%23").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d:*:=%23").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d:==%20:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":*:==%20:*").matches());
-
- // Allow / instead of : (more natural instance expression) jg
- assertFalse(Validator.INST_CHARS.matcher("1234/a").matches());
- assertTrue(Validator.INST_CHARS.matcher("/1234/a").matches());
- assertTrue(Validator.INST_CHARS.matcher("/1234/*/a/").matches());
- assertTrue(Validator.INST_CHARS.matcher("/1234//a").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("1234/a").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("/1234/*/a/").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("1234//a").matches());
-
-
- assertFalse(Validator.INST_CHARS.matcher("1234+235gd").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234-235gd").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234-23_5gd").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234-235g,d").matches());
- assertTrue(Validator.INST_CHARS.matcher("m1234@shb.dd.com").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234-235gd(Version12)").matches());
- assertFalse(Validator.INST_CHARS.matcher("123#4-23@5g:d").matches());
- assertFalse(Validator.INST_CHARS.matcher("123#4-23@5g:d").matches());
- assertFalse(Validator.INST_CHARS.matcher("").matches());
-
-
- for( char c=0x20;c<0x7F;++c) {
- boolean b;
- switch(c) {
- case '?':
- case '|':
- case '*':
- continue; // test separately
- case '~':
- case ',':
- b = false;
- break;
- default:
- b=true;
- }
- }
-
- assertFalse(Validator.ID_CHARS.matcher("abc").matches());
- assertFalse(Validator.ID_CHARS.matcher("").matches());
- assertTrue(Validator.ID_CHARS.matcher("abc@att.com").matches());
- assertTrue(Validator.ID_CHARS.matcher("ab-me@att.com").matches());
- assertTrue(Validator.ID_CHARS.matcher("ab-me_.x@att._-com").matches());
-
- assertFalse(Validator.NAME_CHARS.matcher("ab-me_.x@att._-com").matches());
- assertTrue(Validator.NAME_CHARS.matcher("ab-me").matches());
- assertTrue(Validator.NAME_CHARS.matcher("ab-me_.xatt._-com").matches());
-
-
- // 7/22/2016
- assertTrue(Validator.INST_CHARS.matcher(
- "/!com.att.*/role/write").matches());
- assertTrue(Validator.INST_CHARS.matcher(
- ":!com.att.*:role:write").matches());
-
- }
-
-}
diff --git a/authz-service/src/test/java/org/onap/aaf/authz/service/validation/JU_Validator.java b/authz-service/src/test/java/org/onap/aaf/authz/service/validation/JU_Validator.java
deleted file mode 100644
index e0b49d40..00000000
--- a/authz-service/src/test/java/org/onap/aaf/authz/service/validation/JU_Validator.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * ============LICENSE_START====================================================
- * * org.onap.aaf
- * * ===========================================================================
- * * Copyright © 2017 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====================================================
- * *
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * *
- ******************************************************************************/
-package org.onap.aaf.authz.service.validation;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.aaf.authz.layer.Result;
-import org.onap.aaf.dao.aaf.cass.PermDAO;
-import org.onap.aaf.dao.aaf.cass.RoleDAO;
-
-public class JU_Validator {
-
- Validator validator;
-
- @Before
- public void setUp() {
- validator = new Validator();
- }
-
- @Test
- public void test() {
- assertTrue(Validator.ACTION_CHARS.matcher("HowdyDoody").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("Howd?yDoody").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("_HowdyDoody").matches());
- assertTrue(Validator.INST_CHARS.matcher("HowdyDoody").matches());
- assertFalse(Validator.INST_CHARS.matcher("Howd?yDoody").matches());
- assertTrue(Validator.INST_CHARS.matcher("_HowdyDoody").matches());
-
- //
- assertTrue(Validator.ACTION_CHARS.matcher("*").matches());
- assertTrue(Validator.INST_CHARS.matcher("*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":*:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":*:*").matches());
-
- assertFalse(Validator.ACTION_CHARS.matcher(":hello").matches());
- assertTrue(Validator.INST_CHARS.matcher(":hello").matches());
- assertFalse(Validator.INST_CHARS.matcher("hello:").matches());
- assertFalse(Validator.INST_CHARS.matcher("hello:d").matches());
-
- assertFalse(Validator.ACTION_CHARS.matcher(":hello:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":hello:*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":hello:d*:*").matches());
- assertFalse(Validator.INST_CHARS.matcher(":hello:d*d:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":hello:d*:*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("HowdyDoody*").matches());
- assertFalse(Validator.INST_CHARS.matcher("Howdy*Doody").matches());
- assertTrue(Validator.INST_CHARS.matcher("HowdyDoody*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("*HowdyDoody").matches());
- assertFalse(Validator.INST_CHARS.matcher("*HowdyDoody").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":h*").matches());
- assertFalse(Validator.INST_CHARS.matcher(":h*h*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":h*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":h:h*:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":h:h*:*").matches());
- assertFalse(Validator.INST_CHARS.matcher(":h:h*h:*").matches());
- assertFalse(Validator.INST_CHARS.matcher(":h:h*h*:*").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":h:*:*h").matches());
- assertFalse(Validator.INST_CHARS.matcher(":h:*:*h").matches());
- assertTrue(Validator.INST_CHARS.matcher(":com.test.*:ns:*").matches());
-
- assertFalse(Validator.ACTION_CHARS.matcher("1234+235gd").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("1234-235gd").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("1234-23_5gd").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("1234-235g,d").matches());
- assertTrue(Validator.ACTION_CHARS.matcher("1234-235gd(Version12)").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("123#4-23@5g:d").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("123#4-23@5g:d").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("1234-23 5gd").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("1234-235gd ").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(" 1234-235gd").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(" ").matches());
-
- // Allow % and = (Needed for Escaping & Base64 usages) jg
- assertTrue(Validator.ACTION_CHARS.matcher("1234%235g=d").matches());
- assertFalse(Validator.ACTION_CHARS.matcher(":1234%235g=d").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234%235g=d").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d:%20==").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d:==%20:=%23").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d:*:=%23").matches());
- assertTrue(Validator.INST_CHARS.matcher(":1234%235g=d:==%20:*").matches());
- assertTrue(Validator.INST_CHARS.matcher(":*:==%20:*").matches());
-
- // Allow / instead of : (more natural instance expression) jg
- assertFalse(Validator.INST_CHARS.matcher("1234/a").matches());
- assertTrue(Validator.INST_CHARS.matcher("/1234/a").matches());
- assertTrue(Validator.INST_CHARS.matcher("/1234/*/a/").matches());
- assertTrue(Validator.INST_CHARS.matcher("/1234//a").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("1234/a").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("/1234/*/a/").matches());
- assertFalse(Validator.ACTION_CHARS.matcher("1234//a").matches());
-
- assertFalse(Validator.INST_CHARS.matcher("1234+235gd").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234-235gd").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234-23_5gd").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234-235g,d").matches());
- assertTrue(Validator.INST_CHARS.matcher("m1234@shb.dd.com").matches());
- assertTrue(Validator.INST_CHARS.matcher("1234-235gd(Version12)").matches());
- assertFalse(Validator.INST_CHARS.matcher("123#4-23@5g:d").matches());
- assertFalse(Validator.INST_CHARS.matcher("123#4-23@5g:d").matches());
- assertFalse(Validator.INST_CHARS.matcher("").matches());
-
- for (char c = 0x20; c < 0x7F; ++c) {
- boolean b;
- switch (c) {
- case '?':
- case '|':
- case '*':
- continue; // test separately
- case '~':
- case ',':
- b = false;
- break;
- default:
- b = true;
- }
- }
-
- assertFalse(Validator.ID_CHARS.matcher("abc").matches());
- assertFalse(Validator.ID_CHARS.matcher("").matches());
- assertTrue(Validator.ID_CHARS.matcher("abc@att.com").matches());
- assertTrue(Validator.ID_CHARS.matcher("ab-me@att.com").matches());
- assertTrue(Validator.ID_CHARS.matcher("ab-me_.x@att._-com").matches());
-
- assertFalse(Validator.NAME_CHARS.matcher("ab-me_.x@att._-com").matches());
- assertTrue(Validator.NAME_CHARS.matcher("ab-me").matches());
- assertTrue(Validator.NAME_CHARS.matcher("ab-me_.xatt._-com").matches());
-
- // 7/22/2016
- assertTrue(Validator.INST_CHARS.matcher("/!com.att.*/role/write").matches());
- assertTrue(Validator.INST_CHARS.matcher(":!com.att.*:role:write").matches());
-
- }
-
- @Test
- public void permNotOk() {
-
- Result<PermDAO.Data> rpd = Result.err(1, "ERR_Security");
-
- validator.perm(rpd);
- assertTrue(validator.errs().equals("ERR_Security\n"));
-
- }
-
- @Test
- public void permOkNull() {
-
- Result rpd = Result.ok();
-
- validator.perm(rpd);
- assertTrue(validator.errs().equals("Perm Data is null.\n"));
-
- }
-
- @Test
- public void roleOkNull() {
-
- Result rrd = Result.ok();
-
- validator.role(rrd);
- assertTrue(validator.errs().equals("Role Data is null.\n"));
- }
-
- @Test
- public void roleOk() {
- RoleDAO.Data to = new RoleDAO.Data();
- to.ns = "namespace";
- to.name = "name";
- to.description = "description";
- Set<String> permissions = new HashSet<String>();
- permissions.add("perm1");
- to.perms = permissions;
-
- Result<RoleDAO.Data> rrd = Result.ok(to);
-
- validator.role(rrd);
- assertTrue(
- validator.errs().equals("Perm [perm1] in Role [namespace.name] is not correctly separated with '|'\n"));
- }
-
- @Test
- public void roleNotOk() {
-
- Result rrd = Result.err(1, "ERR_Security");
-
- validator.role(rrd);
- assertTrue(validator.errs().equals("ERR_Security\n"));
- }
-
-}