@Test public void shouldCreateSecurityConfigurationFromReverbSwagger() throws IOException { final String specification = resource("/swagger/reverb.swagger.yaml"); final ConnectorSettings connectorSettings = new ConnectorSettings.Builder()// .name("Reverb API")// .description("Invokes Reverb API")// .icon("fa-music")// .putConfiguredProperty("specification", specification)// .build(); final Connector generated = generator.generate(SWAGGER_TEMPLATE, connectorSettings); assertThat(generated.getProperties().keySet()).contains("accessToken", "authorizationEndpoint", "tokenEndpoint", "clientId", "clientSecret"); assertThat(generated.getProperties().get("authenticationType").getEnum()) .containsExactly(new ConfigurationProperty.PropertyValue.Builder().value("oauth2").label("OAuth 2.0").build()); }
static PropertyValue createPropertyValue(final String value) { return new PropertyValue.Builder().label(value).value(value).build(); }
/* default */ static PropertyValue createPropertyValue(final String value) { return new PropertyValue.Builder().label(value).value(value).build(); }
SupportedAuthenticationTypes(final String label) { this.label = label; propertyValue = new ConfigurationProperty.PropertyValue.Builder().value(name()).label(label).build(); }
SupportedAuthenticationTypes(final String label) { this.label = label; propertyValue = new ConfigurationProperty.PropertyValue.Builder().value(name()).label(label).build(); }