    @Test // KG-2250/KG-2251
    public void testWrongTruststoreType() throws Exception {

        boolean sawExpectedEx = false;

        String expectedLogMessage = "Exception .* caught loading file .*truststore-JCEKS.db.* you may need to specify " +
                "\"<type>JCEKS</type>\" in the gateway configuration file";
        String expected = "Invalid keystore format";
        LogMessageInspector inspector = LogMessageInspector.create(Gateway.class);

        try {
            configFile =
                    createTempFileFromResource("org/kaazing/gateway/server/config/parse/data/gateway-config-wrong-truststore" +
                            "-type.xml");
            GatewayConfigDocument doc = parser.parse(configFile);
            Assert.assertNotNull(doc);
            resolver.resolve(doc);

        } catch (IOException e) {
            if (e.getMessage().contains(expected)) {
                sawExpectedEx = true;
            }
            final List<LoggingEvent> grepResult = inspector.grep(org.apache.log4j.Level.ERROR, expectedLogMessage);
            Assert.assertEquals("Expected to find a matching error message", 1, grepResult.size());

        }

        Assert.assertTrue(String
                .format("Did not see expected IllegalArgumentException with message '%s'", expected), sawExpectedEx);
    }