### Question:
Runner { public static void main(final String ...args) throws RunnerException { try { val configFilePath = Config.getCliConfigOption(args); val properties = Config.parseConfigFileProperties(Paths.get(configFilePath)); val options = Config.createKeyStoreOptions(properties); try (val keyStoreHelper = KeyStoreHelper.create(options)) { keyStoreHelper.run(true); } } catch (SocketEndpointAddressException | KeyStoreHelperException | RunnerException | InvalidParameterException | KeyStoreException e) { log.severe(e.getMessage()); throw new RunnerException(e); } } private  Runner(); static void main(final String ...args);  }### Answer:
@Test void test_Main_TrustStorePassIsMissing() throws URISyntaxException { final Path path = Paths.get(toUri("testdata/cli/missing-truststorepass.conf")); try { Runner.main("-c", path.toString()); fail("expected exception: property is missing"); } catch (RunnerException e) { assertEquals("Missing value for config property: trustStorePass", e.getCause().getMessage()); } }
@Test void test_Main_throwsExceptionIfTheKeystoreCannotBeCreated() throws URISyntaxException, IOException { val file = new File("keystore123.p12"); file.createNewFile(); val configPath = Paths.get(toUri("testdata/cli/correct.conf")); try { Runner.main("-c", configPath.toString()); } catch (RunnerException e) { assertEquals("KeyStore cannot be created", e.getCause().getMessage()); } finally { file.delete(); } }
@Test void test_Main_KeyStorePathIsMissing() throws URISyntaxException { final Path path = Paths.get(toUri("testdata/cli/missing-keystorepath.conf")); try { Runner.main("-c", path.toString()); fail("expected exception: property is missing"); } catch (RunnerException e) { assertEquals("Missing value for config property: keyStorePath", e.getCause().getMessage()); } }
@Test void test_Main_KeyStorePassIsMissing() throws URISyntaxException { final Path path = Paths.get(toUri("testdata/cli/missing-keystorepass.conf")); try { Runner.main("-c", path.toString()); fail("expected exception: property is missing"); } catch (RunnerException e) { assertEquals("Missing value for config property: keyStorePass", e.getCause().getMessage()); } }
@Test void test_Main_KeyPassIsMissing() throws URISyntaxException { final Path path = Paths.get(toUri("testdata/cli/missing-keypass.conf")); try { Runner.main("-c", path.toString()); fail("expected exception: property is missing"); } catch (RunnerException e) { assertEquals("Missing value for config property: keyPass", e.getCause().getMessage()); } }
@Test void test_Main_TrustStorePathIsMissing() throws URISyntaxException { final Path path = Paths.get(toUri("testdata/cli/missing-truststorepath.conf")); try { Runner.main("-c", path.toString()); fail("expected exception: property is missing"); } catch (RunnerException e) { assertEquals("Missing value for config property: trustStorePath", e.getCause().getMessage()); } }