@Test public void testDefaultKeyCertOptionsJson() throws Exception { PemKeyCertOptions def = new PemKeyCertOptions(); PemKeyCertOptions json = new PemKeyCertOptions(new JsonObject()); assertEquals(def.getKeyPath(), json.getKeyPath()); assertEquals(def.getCertPath(), json.getCertPath()); assertEquals(def.getKeyValue(), json.getKeyValue()); assertEquals(def.getCertValue(), json.getCertValue()); }
assertEquals(null, options.getKeyPath()); assertEquals(null, options.getKeyValue()); assertEquals(null, options.getCertPath()); assertEquals(null, options.getCertValue()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Collections.singletonList(keyPath1), options.getKeyPaths()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Arrays.asList(keyPath1, keyPath2), options.getKeyPaths());
assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Collections.singletonList(keyPath1), options.getKeyPaths()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Collections.singletonList(keyPath1), options.getKeyPaths()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Arrays.asList(keyPath1, keyPath2), options.getKeyPaths()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Arrays.asList(keyPath1, keyPath2), options.getKeyPaths());
@Test public void testKeyCertOptions() throws Exception { PemKeyCertOptions options = new PemKeyCertOptions(); assertNull(options.getKeyPath()); String randString = TestUtils.randomAlphaString(100); assertEquals(options, options.setKeyPath(randString)); assertEquals(randString, options.getKeyPath()); assertNull(options.getCertPath()); randString = TestUtils.randomAlphaString(100); assertEquals(options, options.setCertPath(randString)); assertEquals(randString, options.getCertPath()); }
assertEquals(null, options.getKeyPath()); assertEquals(null, options.getKeyValue()); assertEquals(null, options.getCertPath()); assertEquals(null, options.getCertValue()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Collections.singletonList(keyPath1), options.getKeyPaths()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Arrays.asList(keyPath1, keyPath2), options.getKeyPaths());
@Test public void testKeyCertValue() throws Exception { PemKeyCertOptions options = Cert.SERVER_PEM.get(); Buffer key = vertx.fileSystem().readFileBlocking(options.getKeyPath()); options.setKeyValue(null).setKeyValue(key); Buffer cert = vertx.fileSystem().readFileBlocking(options.getCertPath()); options.setCertValue(null).setCertValue(cert); testKeyStore(options); }
assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Collections.singletonList(keyPath1), options.getKeyPaths()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Collections.singletonList(keyPath1), options.getKeyPaths()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Arrays.asList(keyPath1, keyPath2), options.getKeyPaths()); assertEquals(keyPath1, options.getKeyPath()); assertEquals(keyValue1, options.getKeyValue()); assertEquals(certPath1, options.getCertPath()); assertEquals(certValue1, options.getCertValue()); assertEquals(Arrays.asList(keyPath1, keyPath2), options.getKeyPaths());
@Test public void testDefaultKeyCertOptionsJson() throws Exception { PemKeyCertOptions def = new PemKeyCertOptions(); PemKeyCertOptions json = new PemKeyCertOptions(new JsonObject()); assertEquals(def.getKeyPath(), json.getKeyPath()); assertEquals(def.getCertPath(), json.getCertPath()); assertEquals(def.getKeyValue(), json.getKeyValue()); assertEquals(def.getCertValue(), json.getCertValue()); }
@Test public void testKeyCertOptions() throws Exception { PemKeyCertOptions options = new PemKeyCertOptions(); assertNull(options.getKeyPath()); String randString = TestUtils.randomAlphaString(100); assertEquals(options, options.setKeyPath(randString)); assertEquals(randString, options.getKeyPath()); assertNull(options.getCertPath()); randString = TestUtils.randomAlphaString(100); assertEquals(options, options.setCertPath(randString)); assertEquals(randString, options.getCertPath()); }
@Test public void testKeyCertValue() throws Exception { PemKeyCertOptions options = Cert.SERVER_PEM.get(); Buffer key = vertx.fileSystem().readFileBlocking(options.getKeyPath()); options.setKeyValue(null).setKeyValue(key); Buffer cert = vertx.fileSystem().readFileBlocking(options.getCertPath()); options.setCertValue(null).setCertValue(cert); testKeyStore(options); }