.kind("property")//
.kind("property")//
@Test public void shouldCreatePropertyParametersFromPetstoreSwagger() throws IOException { final String specification = resource("/swagger/petstore.swagger.json"); final Swagger swagger = new SwaggerParser().parse(specification); final Parameter petIdPathParameter = swagger.getPath("/pet/{petId}").getGet().getParameters().get(0); final Optional<ConfigurationProperty> maybeConfigurationProperty = BaseSwaggerConnectorGenerator .createPropertyFromParameter(petIdPathParameter); final ConfigurationProperty expected = new ConfigurationProperty.Builder()// .componentProperty(false)// .deprecated(false)// .description("ID of pet to return")// .displayName("petId")// .group("producer")// .javaType(Long.class.getName())// .kind("property")// .required(true)// .secret(false)// .type("integer")// .build(); assertThat(maybeConfigurationProperty).hasValue(expected); }
"accessKey", new ConfigurationProperty.Builder() .kind("accessKey") .secret(true) .raw(true) "secretKey", new ConfigurationProperty.Builder() .kind("secretKey") .secret(true) .raw(true) "region", new ConfigurationProperty.Builder() .kind("region") .secret(false) .componentProperty(false) "bucketNameOrArn", new ConfigurationProperty.Builder() .kind("bucketNameOrArn") .secret(false) .componentProperty(false)
b -> b.putProperty("sObjectName", new ConfigurationProperty.Builder()// .kind("parameter")// .displayName("Salesforce object type")// .group("common")// b -> b.putProperty("sObjectIdName", new ConfigurationProperty.Builder()// .kind("parameter")// .displayName("Identifier field name")// .group("common")//
@Test public void shouldCreatePropertyParametersFromPetstoreSwagger() throws IOException { final String specification = resource("/swagger/petstore.swagger.json"); final Swagger swagger = new SwaggerParser().parse(specification); final Parameter petIdPathParameter = swagger.getPath("/pet/{petId}").getGet().getParameters().get(0); final Optional<ConfigurationProperty> maybeConfigurationProperty = BaseSwaggerConnectorGenerator .createPropertyFromParameter(petIdPathParameter); final ConfigurationProperty expected = new ConfigurationProperty.Builder()// .componentProperty(false)// .deprecated(false)// .description("ID of pet to return")// .displayName("petId")// .group("producer")// .javaType(Long.class.getName())// .kind("property")// .required(true)// .secret(false)// .type("integer")// .build(); assertThat(maybeConfigurationProperty).hasValue(expected); }