use of org.apache.nifi.toolkit.tls.configuration.GetStatusConfig in project nifi by apache.
the class TlsToolkitGetStatusCommandLine method main.
public static void main(String[] args) {
TlsToolkitGetStatusCommandLine commandLine = new TlsToolkitGetStatusCommandLine();
try {
commandLine.parse(args);
} catch (CommandLineParseException e) {
System.exit(e.getExitCode().ordinal());
}
final GetStatusConfig config = commandLine.createConfig();
try {
final TlsToolkitGetStatus tlsToolkitGetStatus = new TlsToolkitGetStatus();
tlsToolkitGetStatus.get(config);
} catch (Exception e) {
commandLine.printUsage("Error communicating with " + config.getUrl().toString() + " (" + e.getMessage() + ")");
System.exit(ExitCode.SERVICE_ERROR.ordinal());
}
System.exit(ExitCode.SUCCESS.ordinal());
}
use of org.apache.nifi.toolkit.tls.configuration.GetStatusConfig in project nifi by apache.
the class TlsToolkitGetStatusCommandLineTest method testSuccess.
@Test
public void testSuccess() {
try {
final String urlStr = "https://localhost:8443/test";
commandLine.parse("-u", urlStr, "-ts", "src/test/resources/localhost/truststore.jks", "-tst", "JKS", "-tsp", "t7rmn1fg8np2ck1sduqdd85opv");
final GetStatusConfig config = commandLine.createConfig();
Assert.assertNotNull(config);
final URI url = config.getUrl();
Assert.assertNotNull(url);
Assert.assertEquals(urlStr, url.toString());
final SSLContext sslContext = config.getSslContext();
Assert.assertNotNull(sslContext);
} catch (CommandLineParseException e) {
fail("Expected success");
}
}
Aggregations