* 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;
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;
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";
* 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 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;
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 {
* 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;
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;
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";
* 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";
* 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 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 {
* 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;
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;
/**
* 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"
* 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;
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;
* 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;