@Test public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("coordinator", "false") .put("presto.version", "test") .put("datasources", "jmx") .put("http.include-exception-in-response", "false") .put("shutdown.grace-period", "5m") .put("sql.parser.enhanced-error-reporting", "false") .build(); ServerConfig expected = new ServerConfig() .setCoordinator(false) .setPrestoVersion("test") .setDataSources("jmx") .setIncludeExceptionInResponse(false) .setGracePeriod(new Duration(5, MINUTES)) .setEnhancedErrorReporting(false); assertFullMapping(properties, expected); } }
@Test public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("coordinator", "false") .put("presto.version", "test") .put("datasources", "jmx") .put("http.include-exception-in-response", "false") .put("shutdown.grace-period", "5m") .put("sql.parser.enhanced-error-reporting", "false") .build(); ServerConfig expected = new ServerConfig() .setCoordinator(false) .setPrestoVersion("test") .setDataSources("jmx") .setIncludeExceptionInResponse(false) .setGracePeriod(new Duration(5, MINUTES)) .setEnhancedErrorReporting(false); assertFullMapping(properties, expected); } }
@Test public void testDefaults() { assertRecordedDefaults(ConfigAssertions.recordDefaults(ServerConfig.class) .setCoordinator(true) .setPrestoVersion(null) .setDataSources(null) .setIncludeExceptionInResponse(true) .setGracePeriod(new Duration(2, MINUTES)) .setEnhancedErrorReporting(true)); }
@Test public void testDefaults() { assertRecordedDefaults(ConfigAssertions.recordDefaults(ServerConfig.class) .setCoordinator(true) .setPrestoVersion(null) .setDataSources(null) .setIncludeExceptionInResponse(true) .setGracePeriod(new Duration(2, MINUTES)) .setEnhancedErrorReporting(true)); }