2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowjava.protocol.api.connection;
11 import static org.junit.Assert.*;
13 import java.util.List;
15 import org.junit.Test;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
19 import com.google.common.collect.Lists;
22 * @author michal.polkorab
25 public class TlsConfigurationImplTest {
28 * Test correct TlsConfigurationImpl creation
32 List<String> cipherSuites = Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256");
33 TlsConfigurationImpl config = new TlsConfigurationImpl(KeystoreType.JKS,
34 "user/dir", PathType.CLASSPATH, KeystoreType.PKCS12, "/var/lib", PathType.PATH, cipherSuites);
35 assertEquals("Wrong keystore location", "/var/lib", config.getTlsKeystore());
36 assertEquals("Wrong truststore location", "user/dir", config.getTlsTruststore());
37 assertEquals("Wrong keystore type", KeystoreType.PKCS12, config.getTlsKeystoreType());
38 assertEquals("Wrong truststore type", KeystoreType.JKS, config.getTlsTruststoreType());
39 assertEquals("Wrong keystore path type", PathType.PATH, config.getTlsKeystorePathType());
40 assertEquals("Wrong truststore path type", PathType.CLASSPATH, config.getTlsTruststorePathType());
41 assertEquals("Wrong certificate password", "opendaylight", config.getCertificatePassword());
42 assertEquals("Wrong keystore password", "opendaylight", config.getKeystorePassword());
43 assertEquals("Wrong truststore password", "opendaylight", config.getTruststorePassword());
44 assertEquals("Wrong cipher suites", cipherSuites, config.getCipherSuites());