summaryrefslogtreecommitdiffstats
path: root/authz-service/src/test/java/com
diff options
context:
space:
mode:
authorsg481n <sg481n@att.com>2017-08-25 00:57:25 -0400
committersg481n <sg481n@att.com>2017-08-25 00:57:35 -0400
commit0e5efc61b657dba874aacc95ee21c76b95fb2028 (patch)
tree27faac27d58557dfeba6db386c6bf0b863b67d0d /authz-service/src/test/java/com
parentdcf76988526af8e15181a29987383af2e1d64156 (diff)
Update aaf client module
Remove aaf submodules and update aaf client module. Issue-id: AAF-21 Change-Id: I750ec9e26596652a142b014db94aabd082880130 Signed-off-by: sg481n <sg481n@att.com>
Diffstat (limited to 'authz-service/src/test/java/com')
-rw-r--r--authz-service/src/test/java/com/att/authz/cadi/JU_DirectAAFLur.java65
-rw-r--r--authz-service/src/test/java/com/att/authz/cadi/JU_DirectAAFUserPass.java72
-rw-r--r--authz-service/src/test/java/com/att/authz/cadi/JU_DirectCertIdentity.java72
-rw-r--r--authz-service/src/test/java/com/att/authz/service/JU_AuthAPI.java75
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_Api.java59
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_Approval.java61
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_Creds.java72
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_Delegate.java55
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_History.java61
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_Mgmt.java58
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_NS.java50
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_Perms.java67
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_Roles.java56
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_User.java56
-rw-r--r--authz-service/src/test/java/com/att/authz/service/api/JU_API_UserRole.java52
-rw-r--r--authz-service/src/test/java/com/att/authz/service/mapper/JU_Mapper_2_0.java163
-rw-r--r--authz-service/src/test/java/com/att/authz/service/test/JU_Validator.java160
-rw-r--r--authz-service/src/test/java/com/att/authz/service/validation/JU_Validator.java177
18 files changed, 0 insertions, 1431 deletions
diff --git a/authz-service/src/test/java/com/att/authz/cadi/JU_DirectAAFLur.java b/authz-service/src/test/java/com/att/authz/cadi/JU_DirectAAFLur.java
deleted file mode 100644
index 52560915..00000000
--- a/authz-service/src/test/java/com/att/authz/cadi/JU_DirectAAFLur.java
+++ /dev/null
@@ -1,65 +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 com.att.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.powermock.modules.junit4.PowerMockRunner;
-
-import com.att.authz.env.AuthzEnv;
-import com.att.cadi.Permission;
-import com.att.dao.aaf.hl.Question;
-@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/com/att/authz/cadi/JU_DirectAAFUserPass.java b/authz-service/src/test/java/com/att/authz/cadi/JU_DirectAAFUserPass.java
deleted file mode 100644
index 4fc015da..00000000
--- a/authz-service/src/test/java/com/att/authz/cadi/JU_DirectAAFUserPass.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 com.att.authz.cadi;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.att.authz.env.AuthzEnv;
-import com.att.cadi.CredVal.Type;
-import com.att.dao.aaf.hl.Question;
-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.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/com/att/authz/cadi/JU_DirectCertIdentity.java b/authz-service/src/test/java/com/att/authz/cadi/JU_DirectCertIdentity.java
deleted file mode 100644
index 6a3f0ca0..00000000
--- a/authz-service/src/test/java/com/att/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 com.att.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.powermock.modules.junit4.PowerMockRunner;
-
-import com.att.dao.aaf.cached.CachedCertDAO;
-
-@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/com/att/authz/service/JU_AuthAPI.java b/authz-service/src/test/java/com/att/authz/service/JU_AuthAPI.java
deleted file mode 100644
index 69738ad1..00000000
--- a/authz-service/src/test/java/com/att/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 com.att.authz.service;
-
-import static org.junit.Assert.*;
-
-import java.util.Properties;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.att.authz.cadi.DirectAAFUserPass;
-import com.att.authz.env.AuthzEnv;
-import com.att.authz.facade.AuthzFacade_2_0;
-import com.att.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/com/att/authz/service/api/JU_API_Api.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_Api.java
deleted file mode 100644
index 3d0b7c86..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_Api.java
+++ /dev/null
@@ -1,59 +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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/api/JU_API_Approval.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_Approval.java
deleted file mode 100644
index 9b4c9eb4..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_Approval.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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/api/JU_API_Creds.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_Creds.java
deleted file mode 100644
index a44d667a..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_Creds.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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.cadi.DirectAAFUserPass;
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-import com.att.inno.env.Env;
-
-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/com/att/authz/service/api/JU_API_Delegate.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_Delegate.java
deleted file mode 100644
index af18d0ed..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_Delegate.java
+++ /dev/null
@@ -1,55 +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 com.att.authz.service.api;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/api/JU_API_History.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_History.java
deleted file mode 100644
index 714f05b1..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_History.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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/api/JU_API_Mgmt.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_Mgmt.java
deleted file mode 100644
index a7ce97fd..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_Mgmt.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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/api/JU_API_NS.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_NS.java
deleted file mode 100644
index 74c56bdc..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_NS.java
+++ /dev/null
@@ -1,50 +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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/api/JU_API_Perms.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_Perms.java
deleted file mode 100644
index 9e4f84f8..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_Perms.java
+++ /dev/null
@@ -1,67 +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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/api/JU_API_Roles.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_Roles.java
deleted file mode 100644
index 26f26996..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_Roles.java
+++ /dev/null
@@ -1,56 +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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/api/JU_API_User.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_User.java
deleted file mode 100644
index fef7c75b..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_User.java
+++ /dev/null
@@ -1,56 +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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/api/JU_API_UserRole.java b/authz-service/src/test/java/com/att/authz/service/api/JU_API_UserRole.java
deleted file mode 100644
index bc385388..00000000
--- a/authz-service/src/test/java/com/att/authz/service/api/JU_API_UserRole.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 com.att.authz.service.api;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-
-import com.att.authz.facade.AuthzFacade;
-import com.att.authz.service.AuthAPI;
-
-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/com/att/authz/service/mapper/JU_Mapper_2_0.java b/authz-service/src/test/java/com/att/authz/service/mapper/JU_Mapper_2_0.java
deleted file mode 100644
index 8896fba7..00000000
--- a/authz-service/src/test/java/com/att/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 com.att.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/com/att/authz/service/test/JU_Validator.java b/authz-service/src/test/java/com/att/authz/service/test/JU_Validator.java
deleted file mode 100644
index 9de77e72..00000000
--- a/authz-service/src/test/java/com/att/authz/service/test/JU_Validator.java
+++ /dev/null
@@ -1,160 +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 com.att.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 com.att.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/com/att/authz/service/validation/JU_Validator.java b/authz-service/src/test/java/com/att/authz/service/validation/JU_Validator.java
deleted file mode 100644
index df7222b8..00000000
--- a/authz-service/src/test/java/com/att/authz/service/validation/JU_Validator.java
+++ /dev/null
@@ -1,177 +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 com.att.authz.service.validation;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import com.att.authz.cadi.DirectAAFLur.PermPermission;
-import com.att.authz.env.AuthzTrans;
-import com.att.authz.layer.Result;
-import com.att.authz.org.Organization;
-import com.att.dao.aaf.cass.CredDAO;
-import com.att.dao.aaf.cass.DelegateDAO;
-import com.att.dao.aaf.cass.Namespace;
-import com.att.dao.aaf.cass.PermDAO;
-import com.att.dao.aaf.cass.RoleDAO;
-import com.att.dao.aaf.cass.UserRoleDAO;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.att.authz.service.validation.Validator;
-
-public class JU_Validator {
-
- @Before
- public void setUp(){
- Validator 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());
-
- }
-
-}