@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); }
new ConfigurationProperty.Builder() .componentProperty(false) .secret(true) .build()) .putProperty("password", new ConfigurationProperty.Builder() .componentProperty(false) .secret(true) .build()) .putProperty("token", new ConfigurationProperty.Builder() .componentProperty(true) .secret(true) .build()) .build(); new ConfigurationProperty.Builder() .componentProperty(false) .secret(true) .build()) .putProperty("password", new ConfigurationProperty.Builder() .componentProperty(false) .secret(true) .build()) .putProperty("token", new ConfigurationProperty.Builder() .componentProperty(true) .secret(true)
new ConfigurationProperty.Builder() .kind("accessKey") .secret(true) .raw(true) .componentProperty(false) new ConfigurationProperty.Builder() .kind("secretKey") .secret(true) .raw(true) .componentProperty(false) new ConfigurationProperty.Builder() .kind("region") .secret(false) .componentProperty(false) .build()) new ConfigurationProperty.Builder() .kind("bucketNameOrArn") .secret(false) .componentProperty(false) .build())
@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); }