@JsonCreator public FileSystemConfig( @JsonProperty("connection") String connection, @JsonProperty("path") String path, @JsonProperty("config") Map<String, String> config, @JsonProperty("formats") Map<String, FormatPluginConfig> formats, @JsonProperty(value = "impersonationEnabled", defaultValue = "false") boolean impersonationEnabled, @JsonProperty(value = "schemaMutability", defaultValue = "ALL") SchemaMutability schemaMutability) { this.connection = connection; this.path = path == null ? "/" : path; this.config = (config == null) ? null : ImmutableMap.copyOf(config); this.formats = (formats == null) ? null : ImmutableMap.copyOf(formats); this.impersonationEnabled = impersonationEnabled; this.uri = connection == null? null: getURI(connection); this.schemaMutability = schemaMutability == null ? SchemaMutability.ALL : schemaMutability; }
@Test public void ensureFilesystemIsType() throws Exception { LogicalPlanPersistence lpp = new LogicalPlanPersistence(DEFAULT_SABOT_CONFIG, CLASSPATH_SCAN_RESULT); ObjectMapper mapper = lpp.getMapper(); String val = mapper.writeValueAsString(new ExampleHolder(new FileSystemConfig(new URI("file:///"), SchemaMutability.ALL))); assertTrue(String.format("Expected config to contain %s but did not. Actual value %s.", FileSystemConfig.NAME, val), val.contains(FileSystemConfig.NAME)); }