@Test public void shouldDetermineConnectorName() { final Oas20Document openApiDoc = new Oas20Document(); assertThat(generator.determineConnectorName(ApiConnectorTemplate.SWAGGER_TEMPLATE, createSettingsFrom(openApiDoc))).isEqualTo("unspecified"); final Oas20Info info = (Oas20Info) openApiDoc.createInfo(); openApiDoc.info = info; assertThat(generator.determineConnectorName(ApiConnectorTemplate.SWAGGER_TEMPLATE, createSettingsFrom(openApiDoc))).isEqualTo("unspecified"); info.title = "title"; assertThat(generator.determineConnectorName(ApiConnectorTemplate.SWAGGER_TEMPLATE, createSettingsFrom(openApiDoc))).isEqualTo("title"); }
@Override protected final String determineConnectorName(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.NONE); if (!modelInfo.getErrors().isEmpty()) { throw new IllegalArgumentException("Given OpenAPI specification contains errors: " + modelInfo); } final OasDocument openApiDoc = modelInfo.getModel(); final Info info = openApiDoc.info; if (info == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } final String title = info.title; if (title == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } return title; }
OpenApiConnectorGenerator extends ConnectorGenerator { @Override protected final String determineConnectorName(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.NONE); if (!modelInfo.getErrors().isEmpty()) { throw new IllegalArgumentException("Given OpenAPI specification contains errors: " + modelInfo); } final OasDocument openApiDoc = modelInfo.getModel(); final Info info = openApiDoc.info; if (info == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } final String title = info.title; if (title == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } return title; } }
OpenApiConnectorGenerator extends ConnectorGenerator { @Override protected final String determineConnectorName(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.NONE); if (!modelInfo.getErrors().isEmpty()) { throw new IllegalArgumentException("Given OpenAPI specification contains errors: " + modelInfo); } final OasDocument openApiDoc = modelInfo.getModel(); final Info info = openApiDoc.info; if (info == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } final String title = info.title; if (title == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } return title; } OpenApiConnectorGenerator(final Connector baseConnector, final Supplier<String> operationIdGenerator);  OpenApiConnectorGenerator(final Connector baseConnector); }
OpenApiConnectorGenerator extends ConnectorGenerator { @Override protected final String determineConnectorName(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.NONE); if (!modelInfo.getErrors().isEmpty()) { throw new IllegalArgumentException("Given OpenAPI specification contains errors: " + modelInfo); } final OasDocument openApiDoc = modelInfo.getModel(); final Info info = openApiDoc.info; if (info == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } final String title = info.title; if (title == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } return title; } OpenApiConnectorGenerator(final Connector baseConnector, final Supplier<String> operationIdGenerator);  OpenApiConnectorGenerator(final Connector baseConnector); @Override final Connector generate(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings); @Override final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings); }
OpenApiConnectorGenerator extends ConnectorGenerator { @Override protected final String determineConnectorName(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.NONE); if (!modelInfo.getErrors().isEmpty()) { throw new IllegalArgumentException("Given OpenAPI specification contains errors: " + modelInfo); } final OasDocument openApiDoc = modelInfo.getModel(); final Info info = openApiDoc.info; if (info == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } final String title = info.title; if (title == null) { return super.determineConnectorName(connectorTemplate, connectorSettings); } return title; } OpenApiConnectorGenerator(final Connector baseConnector, final Supplier<String> operationIdGenerator);  OpenApiConnectorGenerator(final Connector baseConnector); @Override final Connector generate(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings); @Override final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings); static final String SPECIFICATION; }