use of org.apache.qpid.tests.http.HttpTestHelper in project qpid-broker-j by apache.
the class PortTest method testSwapKeyStoreAndUpdateTlsOnHttpPort.
@Test
public void testSwapKeyStoreAndUpdateTlsOnHttpPort() throws Exception {
final int port = createHttpPort();
HttpTestHelper helper = new HttpTestHelper(getBrokerAdmin(), null, port);
helper.setTls(true);
helper.setKeyStore(_storeFile.getAbsolutePath(), TLS_RESOURCE.getSecret());
final Map<String, Object> attributes = getHelper().getJsonAsMap("port/" + _portName);
final Map<String, Object> ownAttributes = helper.getJsonAsMap("port/" + _portName);
assertEquals(attributes, ownAttributes);
final File storeFile = createNewKeyStoreAndSetItOnPort();
helper.setKeyStore(storeFile.getAbsolutePath(), TLS_RESOURCE.getSecret());
final Map<String, Object> attributes2 = getHelper().getJsonAsMap("port/" + _portName);
final Map<String, Object> ownAttributes2 = helper.getJsonAsMap("port/" + _portName);
assertEquals(attributes2, ownAttributes2);
}
Aggregations