Clean up UT placement 58/104258/3
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 5 Feb 2023 17:23:46 +0000 (18:23 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 6 Feb 2023 09:20:27 +0000 (10:20 +0100)
Unit tests should be located in the same package as the class being
tested. Clean all that up.

Change-Id: I62fbc4ba67d28fcd4361f2a9ef32385d3880cb1f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/AaaCertMdsalProviderTest.java [moved from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/AaaCertMdsalProviderTest.java with 96% similarity]
aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/AaaCertProviderTest.java [moved from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/AaaCertProviderTest.java with 95% similarity]
aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/AaaCertRpcServiceImplTest.java [moved from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/AaaCertRpcServiceImplTest.java with 96% similarity]
aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/KeyStoreUtilisTest.java [moved from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/KeyStoreUtilisTest.java with 92% similarity]
aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/ODLKeyToolTest.java [moved from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/ODLKeyToolTest.java with 95% similarity]
aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/TestUtils.java [moved from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/TestUtils.java with 92% similarity]
aaa-cert/src/test/java/org/opendaylight/aaa/cert/utils/KeyStoresDataUtilsTest.java [moved from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/KeyStoresDataUtilsTest.java with 98% similarity]
aaa-cert/src/test/java/org/opendaylight/aaa/cert/utils/MdsalUtilsTest.java [moved from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/MdsalUtilsTest.java with 97% similarity]

similarity index 96%
rename from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/AaaCertMdsalProviderTest.java
rename to aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/AaaCertMdsalProviderTest.java
index 3f331b56315f7ae586d87cb23ed32c662c40d6ad..bc7aa3cc2f1105504a333d5af34af8ea9bbf2276 100644 (file)
@@ -5,14 +5,14 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.aaa.cert.test;
+package org.opendaylight.aaa.cert.impl;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
-import static org.opendaylight.aaa.cert.test.TestUtils.mockDataBroker;
+import static org.opendaylight.aaa.cert.impl.TestUtils.mockDataBroker;
 
 import java.io.File;
 import java.security.KeyStore;
@@ -23,9 +23,6 @@ import java.util.List;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.opendaylight.aaa.cert.impl.AaaCertMdsalProvider;
-import org.opendaylight.aaa.cert.impl.KeyStoreConstant;
-import org.opendaylight.aaa.cert.impl.ODLKeyTool;
 import org.opendaylight.aaa.cert.utils.KeyStoresDataUtils;
 import org.opendaylight.aaa.encrypt.AAAEncryptionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.mdsal.rev160321.cipher.suite.CipherSuites;
@@ -37,9 +34,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.mdsal.rev1603
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.mdsal.rev160321.ssl.data.TrustKeystore;
 
 public class AaaCertMdsalProviderTest {
-    private static final String ALIAS = TestUtils.dummyAlias;
+    private static final String ALIAS = TestUtils.DUMMY_ALIAS;
     private static final String BUNDLE_NAME = "opendaylight";
-    private static final String CERTIFICATE = TestUtils.dummyCert;
+    private static final String CERTIFICATE = TestUtils.DUMMY_CERT;
     private static final String CIPHER_SUITE_NAME = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256";
     private static final String[] CIPHER_SUITES_ARRAY = { CIPHER_SUITE_NAME };
     private static final String D_NAME = "CN=ODL, OU=Dev, O=LinuxFoundation, L=QC Montreal, C=CA";
similarity index 95%
rename from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/AaaCertProviderTest.java
rename to aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/AaaCertProviderTest.java
index 0653aeed5ecb652e484922f8279917df06f8f0f6..1f726322a015b287a5ccc9b13caa3413c9693666 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.aaa.cert.test;
+package org.opendaylight.aaa.cert.impl;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -16,8 +16,6 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.junit.MockitoJUnitRunner;
-import org.opendaylight.aaa.cert.impl.AaaCertProvider;
-import org.opendaylight.aaa.cert.impl.KeyStoreConstant;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rev151126.aaa.cert.service.config.CtlKeystore;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rev151126.aaa.cert.service.config.CtlKeystoreBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rev151126.aaa.cert.service.config.TrustKeystore;
@@ -30,8 +28,8 @@ public class AaaCertProviderTest {
     private static CtlKeystore ctlKeyStore;
     private static TrustKeystore trustKeyStore;
 
-    private final String dummyAlias = TestUtils.dummyAlias;
-    private final String dummyCert = TestUtils.dummyCert;
+    private final String dummyAlias = TestUtils.DUMMY_ALIAS;
+    private final String dummyCert = TestUtils.DUMMY_CERT;
 
     @Test
     public void testCertificate() throws InterruptedException, ExecutionException {
similarity index 96%
rename from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/AaaCertRpcServiceImplTest.java
rename to aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/AaaCertRpcServiceImplTest.java
index e2786a522d5c8b17f3c673993aa948d928838fe8..43414b622377707235cc84aec271aac74e3b6e23 100644 (file)
@@ -5,14 +5,14 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.aaa.cert.test;
+package org.opendaylight.aaa.cert.impl;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
-import static org.opendaylight.aaa.cert.test.TestUtils.mockDataBroker;
+import static org.opendaylight.aaa.cert.impl.TestUtils.mockDataBroker;
 
 import java.io.File;
 import java.security.Security;
@@ -23,9 +23,6 @@ import java.util.concurrent.Future;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.opendaylight.aaa.cert.impl.AaaCertRpcServiceImpl;
-import org.opendaylight.aaa.cert.impl.KeyStoreConstant;
-import org.opendaylight.aaa.cert.impl.ODLKeyTool;
 import org.opendaylight.aaa.cert.utils.KeyStoresDataUtils;
 import org.opendaylight.aaa.encrypt.AAAEncryptionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.mdsal.rev160321.cipher.suite.CipherSuites;
@@ -49,9 +46,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rpc.rev151215
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 public class AaaCertRpcServiceImplTest {
-    private static final String ALIAS = TestUtils.dummyAlias;
+    private static final String ALIAS = TestUtils.DUMMY_ALIAS;
     private static final String BUNDLE_NAME = "opendaylight";
-    private static final String CERTIFICATE = TestUtils.dummyCert;
+    private static final String CERTIFICATE = TestUtils.DUMMY_CERT;
     private static final String CIPHER_SUITE_NAME = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256";
     private static final String[] CIPHER_SUITES_ARRAY = { CIPHER_SUITE_NAME };
     private static final String D_NAME = "CN=ODL, OU=Dev, O=LinuxFoundation, L=QC Montreal, C=CA";
similarity index 92%
rename from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/KeyStoreUtilisTest.java
rename to aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/KeyStoreUtilisTest.java
index 72aaeb5675779f550b4261b2426b4904fc5769ad..dbd534a2f3d74c974c06b6500feb9af26c934c24 100644 (file)
@@ -5,14 +5,13 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.aaa.cert.test;
+package org.opendaylight.aaa.cert.impl;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import org.junit.Test;
-import org.opendaylight.aaa.cert.impl.KeyStoreConstant;
 
 public class KeyStoreUtilisTest {
     private static final String FILE_NAME = "foo.pem";
similarity index 95%
rename from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/ODLKeyToolTest.java
rename to aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/ODLKeyToolTest.java
index 0c19d9584a4a7ba6edee2fb78ab3bd9bec8a5e49..05f7abf17b7876e828328d0ba4931b8cbb09cd7e 100644 (file)
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.aaa.cert.test;
+package org.opendaylight.aaa.cert.impl;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -17,8 +17,6 @@ import java.security.Security;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.opendaylight.aaa.cert.impl.KeyStoreConstant;
-import org.opendaylight.aaa.cert.impl.ODLKeyTool;
 
 public class ODLKeyToolTest {
 
similarity index 92%
rename from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/TestUtils.java
rename to aaa-cert/src/test/java/org/opendaylight/aaa/cert/impl/TestUtils.java
index b5215cfd4c920dc890ce3f94683290a557b8f12e..a1c2e951483245b1164928db35fbf795587041bb 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.aaa.cert.test;
+package org.opendaylight.aaa.cert.impl;
 
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
@@ -13,7 +13,6 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import java.util.Optional;
-import org.opendaylight.aaa.cert.impl.KeyStoreConstant;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
 import org.opendaylight.mdsal.binding.api.WriteTransaction;
@@ -23,12 +22,10 @@ import org.opendaylight.yangtools.util.concurrent.FluentFutures;
 
 /**
  * Utilities for test, the certificate needs to be updated yearly.
- * Last update: 8 march 2017
  */
-
 public final class TestUtils {
-    public static String dummyAlias = "fooAlias";
-    public static String dummyCert = KeyStoreConstant.BEGIN_CERTIFICATE
+    public static final String DUMMY_ALIAS = "fooAlias";
+    public static final String DUMMY_CERT = KeyStoreConstant.BEGIN_CERTIFICATE
             + "MIIDTzCCAjegAwIBAgIJAMrURYFr+EdHMA0GCSqGSIb3DQEBCwUAMD4xPDA6BgNV"
             + "BAMMM09ETCwgT1U9RGV2LCBPPUxpbnV4Rm91bmRhdGlvbiwgTD1RQyBNb250cmVh"
             + "bCwgQz1DQTAeFw0xODAzMDUxNjAxNTFaFw0yODAzMDIxNjAxNTFaMD4xPDA6BgNV"
similarity index 98%
rename from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/KeyStoresDataUtilsTest.java
rename to aaa-cert/src/test/java/org/opendaylight/aaa/cert/utils/KeyStoresDataUtilsTest.java
index 6d43435301036f358a7bd2d5d60131e7f0881984..978d5106d287577abb7794d83733aae512f18ee2 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.aaa.cert.test;
+package org.opendaylight.aaa.cert.utils;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -26,7 +26,6 @@ import org.junit.runner.RunWith;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.aaa.cert.impl.KeyStoreConstant;
 import org.opendaylight.aaa.cert.impl.ODLKeyTool;
-import org.opendaylight.aaa.cert.utils.KeyStoresDataUtils;
 import org.opendaylight.aaa.encrypt.AAAEncryptionService;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
similarity index 97%
rename from aaa-cert/src/test/java/org/opendaylight/aaa/cert/test/MdsalUtilsTest.java
rename to aaa-cert/src/test/java/org/opendaylight/aaa/cert/utils/MdsalUtilsTest.java
index 3e148c3251ee7eeded24464d1c4ff7f30b07a2b8..1a61036efcfdb825000927c2f3991b0db7d848ce 100644 (file)
@@ -5,14 +5,14 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.aaa.cert.test;
+package org.opendaylight.aaa.cert.utils;
 
 import static org.junit.Assert.assertTrue;
 
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.aaa.cert.impl.KeyStoreConstant;
-import org.opendaylight.aaa.cert.utils.MdsalUtils;
+import org.opendaylight.aaa.cert.impl.TestUtils;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.mdsal.rev160321.KeyStores;