Update project structure to org.onap.aaf
[aaf/authz.git] / authz-core / src / test / java / org / onap / aaf / authz / common / JU_Define.java
diff --git a/authz-core/src/test/java/org/onap/aaf/authz/common/JU_Define.java b/authz-core/src/test/java/org/onap/aaf/authz/common/JU_Define.java
new file mode 100644 (file)
index 0000000..48c8499
--- /dev/null
@@ -0,0 +1,64 @@
+/*******************************************************************************\r
+ * ============LICENSE_START====================================================\r
+ * * org.onap.aaf\r
+ * * ===========================================================================\r
+ * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
+ * * ===========================================================================\r
+ * * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * * you may not use this file except in compliance with the License.\r
+ * * You may obtain a copy of the License at\r
+ * * \r
+ *  *      http://www.apache.org/licenses/LICENSE-2.0\r
+ * * \r
+ *  * Unless required by applicable law or agreed to in writing, software\r
+ * * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * * See the License for the specific language governing permissions and\r
+ * * limitations under the License.\r
+ * * ============LICENSE_END====================================================\r
+ * *\r
+ * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
+ * *\r
+ ******************************************************************************/\r
+package org.onap.aaf.authz.common;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import org.junit.runner.RunWith;\r
+import org.mockito.Matchers;\r
+import org.mockito.Mock;\r
+import org.onap.aaf.authz.common.Define;\r
+import org.powermock.api.mockito.PowerMockito;\r
+import org.powermock.modules.junit4.PowerMockRunner;\r
+\r
+import org.onap.aaf.cadi.CadiException;\r
+import org.onap.aaf.cadi.config.Config;\r
+import org.onap.aaf.inno.env.Env;\r
+\r
+@RunWith(PowerMockRunner.class)\r
+public class JU_Define {\r
+       Define define;\r
+       public static String ROOT_NS="NS.Not.Set";\r
+       public static String ROOT_COMPANY=ROOT_NS;\r
+       \r
+       @Mock \r
+       Env envMock;\r
+       \r
+       \r
+       @Before\r
+       public void setUp(){\r
+               define = new Define();\r
+       }\r
+\r
+       @Test\r
+       public void testSet() throws CadiException {\r
+               PowerMockito.when(envMock.getProperty(Config.AAF_ROOT_NS)).thenReturn("aaf_root_ns");\r
+               PowerMockito.when(envMock.getProperty(Config.AAF_ROOT_COMPANY)).thenReturn("aaf_root_company");\r
+               //PowerMockito.when(envMock.init().log()).thenReturn(null);\r
+               //PowerMockito.doNothing().doThrow(new CadiException()).when(envMock).init().log(Matchers.anyString());\r
+               define.set(envMock);\r
+       }\r
+\r
+}\r