diff options
author | Instrumental <jcgmisc@stl.gathman.org> | 2018-03-26 13:51:48 -0700 |
---|---|---|
committer | Instrumental <jcgmisc@stl.gathman.org> | 2018-03-26 13:52:07 -0700 |
commit | 71037c39a37d3549dcfe31926832a657744fbe05 (patch) | |
tree | 78911b2b5e86e4e44228f7a27b3a8cd954b7f3e2 /auth/auth-service/src/test | |
parent | a20accc73189d8e5454cd26049c0e6fae75da16f (diff) |
AT&T 2.0.19 Code drop, stage 3
Issue-ID: AAF-197
Change-Id: I8b02cb073ccba318ccaf6ea0276446bdce88fb82
Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'auth/auth-service/src/test')
13 files changed, 933 insertions, 0 deletions
diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/.gitignore b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/.gitignore new file mode 100644 index 00000000..0417a4bc --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/.gitignore @@ -0,0 +1 @@ +/JU_API_Api.java diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Approval.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Approval.java new file mode 100644 index 00000000..010417c5 --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Approval.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +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.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_Approval; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_Approval { + API_Approval api_Approval; + + @Mock + AAF_Service 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); + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Creds.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Creds.java new file mode 100644 index 00000000..9f33f496 --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Creds.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +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.auth.direct.DirectAAFUserPass; +import org.onap.aaf.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_Creds; +import org.onap.aaf.misc.env.Env; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_Creds { + + API_Creds api_Creds; + @Mock + AAF_Service 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(); + } + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Delegate.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Delegate.java new file mode 100644 index 00000000..1e4f1441 --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Delegate.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +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.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_Delegate; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_Delegate { + API_Delegate api_Delegate; + @Mock + AAF_Service 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(); + } + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_History.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_History.java new file mode 100644 index 00000000..28fca969 --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_History.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +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.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_History; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_History { + API_History api_History; + + @Mock + AAF_Service 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); + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Mgmt.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Mgmt.java new file mode 100644 index 00000000..10f08e9d --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Mgmt.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +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.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_Mgmt; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_Mgmt { + API_Mgmt api_Mgmt; + + @Mock + AAF_Service 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(); + } + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_NS.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_NS.java new file mode 100644 index 00000000..05803414 --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_NS.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.onap.aaf.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_NS; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_NS { + API_NS api_Ns; + @Mock + AAF_Service 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(); + } + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Perms.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Perms.java new file mode 100644 index 00000000..aa62433b --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Perms.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +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.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_Perms; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_Perms { + API_Perms api_Perms; + @Mock + AAF_Service 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(); + } + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Roles.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Roles.java new file mode 100644 index 00000000..e890ef5a --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_Roles.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +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.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_Roles; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_Roles { + API_Roles api_Roles; + @Mock + AAF_Service 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(); + } + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_User.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_User.java new file mode 100644 index 00000000..6c0ca0ce --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_User.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +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.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_User; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_User { + API_User api_User; + @Mock + AAF_Service 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(); + } + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_UserRole.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_UserRole.java new file mode 100644 index 00000000..72954134 --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/api/test/JU_API_UserRole.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.api.test; + +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.auth.service.AAF_Service; +import org.onap.aaf.auth.service.api.API_UserRole; + +import org.onap.aaf.auth.service.facade.AuthzFacade; + +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) +public class JU_API_UserRole { + API_UserRole api_UserRole; + @Mock + AAF_Service 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(); + } + } + + @Test + public void notYetImplemented() { + fail("Tests in this file should not be trusted"); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/validation/test/JU_ServiceValidator.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/validation/test/JU_ServiceValidator.java new file mode 100644 index 00000000..a0e5bfa6 --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/validation/test/JU_ServiceValidator.java @@ -0,0 +1,102 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +package org.onap.aaf.auth.service.validation.test; + +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.auth.dao.cass.PermDAO; +import org.onap.aaf.auth.dao.cass.RoleDAO; +import org.onap.aaf.auth.layer.Result; +import org.onap.aaf.auth.service.validation.ServiceValidator; +import org.onap.aaf.auth.validation.Validator; + +public class JU_ServiceValidator { + + ServiceValidator validator; + + @Before + public void setUp() { + validator = new ServiceValidator(); + } + + @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")); + } + +} diff --git a/auth/auth-service/src/test/java/org/onap/aaf/authz/service/mapper/JU_Mapper_2_0.java b/auth/auth-service/src/test/java/org/onap/aaf/authz/service/mapper/JU_Mapper_2_0.java new file mode 100644 index 00000000..b3630c7a --- /dev/null +++ b/auth/auth-service/src/test/java/org/onap/aaf/authz/service/mapper/JU_Mapper_2_0.java @@ -0,0 +1,162 @@ +/******************************************************************************* + * ============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==================================================== + * * + * * + ******************************************************************************/ +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); + } + + + +} |