@Test public void testNoComponentsDefined(@Injectable final OpenAPI openAPI, @Injectable final ResolverCache cache) throws Exception { new StrictExpectations() {{ new SchemaProcessor(cache, openAPI); times = 1; result = schemaProcessor; new ResponseProcessor(cache, openAPI); times = 1; result = responseProcessor; new RequestBodyProcessor(cache, openAPI); times = 1; result = requestBodyProcessor; new ParameterProcessor( cache, openAPI); times = 1; result = parameterProcessor; new HeaderProcessor(cache, openAPI); times = 1; result = headerProcessor; new ExampleProcessor(cache, openAPI); times = 1; result = exampleProcessor; new LinkProcessor(cache, openAPI); times = 1; result = linkProcessor; new CallbackProcessor(cache, openAPI); times = 1; result = callbackProcessor; new SecuritySchemeProcessor(cache, openAPI); times = 1; result = securitySchemeProcessor; openAPI.getComponents(); times = 1; result = null; }}; new ComponentsProcessor(openAPI,cache).processComponents(); new FullVerifications() {{ }}; }
public void processComponents() { if (openApi.getComponents() == null){ return; } final Map<String, ApiResponse> responses = openApi.getComponents().getResponses(); final Map<String, RequestBody> requestBodies = openApi.getComponents().getRequestBodies(); final Map<String, Parameter> parameters = openApi.getComponents().getParameters(); final Map<String, Header> headers = openApi.getComponents().getHeaders(); final Map<String, Example> examples = openApi.getComponents().getExamples(); final Map<String, Link> links = openApi.getComponents().getLinks(); final Map<String, Callback> callbacks = openApi.getComponents().getCallbacks(); final Map<String, SecurityScheme> securitySchemes = openApi.getComponents().getSecuritySchemes(); if (responses != null) { Set<String> keySet = new LinkedHashSet<>(); while(responses.keySet().size() > keySet.size()) { processResponses(keySet, responses); } } if (requestBodies != null) { Set<String> keySet = new LinkedHashSet<>(); while(requestBodies.keySet().size() > keySet.size()) { processRequestBodies(keySet, requestBodies); } } if (parameters != null) { Set<String> keySet = new LinkedHashSet<>(); while(parameters.keySet().size() > keySet.size()) { processParameters(keySet, parameters); } } if (headers != null) { Set<String> keySet = new LinkedHashSet<>(); while(headers.keySet().size() > keySet.size()) { processHeaders(keySet, headers); } } if (examples != null) { Set<String> keySet = new LinkedHashSet<>(); while(examples.keySet().size() > keySet.size()) { processExamples(keySet, examples); } } if (links != null) { Set<String> keySet = new LinkedHashSet<>(); while(links.keySet().size() > keySet.size()) { processLinks(keySet, links); } } if (callbacks != null) { Set<String> keySet = new LinkedHashSet<>(); while(callbacks.keySet().size() > keySet.size()) { processCallbacks(keySet, callbacks); } } if (securitySchemes != null) { Set<String> keySet = new LinkedHashSet<>(); while(securitySchemes.keySet().size() > keySet.size()) { processSecuritySchemes(keySet, securitySchemes); } } final Map<String, Schema> schemas = openApi.getComponents().getSchemas(); if (schemas != null) { Set<String> keySet = new LinkedHashSet<>(); while(schemas.keySet().size() > keySet.size()) { processSchemas(keySet, schemas); } } }
ComponentsProcessor { public void processComponents() { if (openApi.getComponents() == null){ return; } final Map<String, ApiResponse> responses = openApi.getComponents().getResponses(); final Map<String, RequestBody> requestBodies = openApi.getComponents().getRequestBodies(); final Map<String, Parameter> parameters = openApi.getComponents().getParameters(); final Map<String, Header> headers = openApi.getComponents().getHeaders(); final Map<String, Example> examples = openApi.getComponents().getExamples(); final Map<String, Link> links = openApi.getComponents().getLinks(); final Map<String, Callback> callbacks = openApi.getComponents().getCallbacks(); final Map<String, SecurityScheme> securitySchemes = openApi.getComponents().getSecuritySchemes(); if (responses != null) { Set<String> keySet = new LinkedHashSet<>(); while(responses.keySet().size() > keySet.size()) { processResponses(keySet, responses); } } if (requestBodies != null) { Set<String> keySet = new LinkedHashSet<>(); while(requestBodies.keySet().size() > keySet.size()) { processRequestBodies(keySet, requestBodies); } } if (parameters != null) { Set<String> keySet = new LinkedHashSet<>(); while(parameters.keySet().size() > keySet.size()) { processParameters(keySet, parameters); } } if (headers != null) { Set<String> keySet = new LinkedHashSet<>(); while(headers.keySet().size() > keySet.size()) { processHeaders(keySet, headers); } } if (examples != null) { Set<String> keySet = new LinkedHashSet<>(); while(examples.keySet().size() > keySet.size()) { processExamples(keySet, examples); } } if (links != null) { Set<String> keySet = new LinkedHashSet<>(); while(links.keySet().size() > keySet.size()) { processLinks(keySet, links); } } if (callbacks != null) { Set<String> keySet = new LinkedHashSet<>(); while(callbacks.keySet().size() > keySet.size()) { processCallbacks(keySet, callbacks); } } if (securitySchemes != null) { Set<String> keySet = new LinkedHashSet<>(); while(securitySchemes.keySet().size() > keySet.size()) { processSecuritySchemes(keySet, securitySchemes); } } final Map<String, Schema> schemas = openApi.getComponents().getSchemas(); if (schemas != null) { Set<String> keySet = new LinkedHashSet<>(); while(schemas.keySet().size() > keySet.size()) { processSchemas(keySet, schemas); } } } }
ComponentsProcessor { public void processComponents() { if (openApi.getComponents() == null){ return; } final Map<String, ApiResponse> responses = openApi.getComponents().getResponses(); final Map<String, RequestBody> requestBodies = openApi.getComponents().getRequestBodies(); final Map<String, Parameter> parameters = openApi.getComponents().getParameters(); final Map<String, Header> headers = openApi.getComponents().getHeaders(); final Map<String, Example> examples = openApi.getComponents().getExamples(); final Map<String, Link> links = openApi.getComponents().getLinks(); final Map<String, Callback> callbacks = openApi.getComponents().getCallbacks(); final Map<String, SecurityScheme> securitySchemes = openApi.getComponents().getSecuritySchemes(); if (responses != null) { Set<String> keySet = new LinkedHashSet<>(); while(responses.keySet().size() > keySet.size()) { processResponses(keySet, responses); } } if (requestBodies != null) { Set<String> keySet = new LinkedHashSet<>(); while(requestBodies.keySet().size() > keySet.size()) { processRequestBodies(keySet, requestBodies); } } if (parameters != null) { Set<String> keySet = new LinkedHashSet<>(); while(parameters.keySet().size() > keySet.size()) { processParameters(keySet, parameters); } } if (headers != null) { Set<String> keySet = new LinkedHashSet<>(); while(headers.keySet().size() > keySet.size()) { processHeaders(keySet, headers); } } if (examples != null) { Set<String> keySet = new LinkedHashSet<>(); while(examples.keySet().size() > keySet.size()) { processExamples(keySet, examples); } } if (links != null) { Set<String> keySet = new LinkedHashSet<>(); while(links.keySet().size() > keySet.size()) { processLinks(keySet, links); } } if (callbacks != null) { Set<String> keySet = new LinkedHashSet<>(); while(callbacks.keySet().size() > keySet.size()) { processCallbacks(keySet, callbacks); } } if (securitySchemes != null) { Set<String> keySet = new LinkedHashSet<>(); while(securitySchemes.keySet().size() > keySet.size()) { processSecuritySchemes(keySet, securitySchemes); } } final Map<String, Schema> schemas = openApi.getComponents().getSchemas(); if (schemas != null) { Set<String> keySet = new LinkedHashSet<>(); while(schemas.keySet().size() > keySet.size()) { processSchemas(keySet, schemas); } } } ComponentsProcessor(OpenAPI openApi,ResolverCache cache); }
ComponentsProcessor { public void processComponents() { if (openApi.getComponents() == null){ return; } final Map<String, ApiResponse> responses = openApi.getComponents().getResponses(); final Map<String, RequestBody> requestBodies = openApi.getComponents().getRequestBodies(); final Map<String, Parameter> parameters = openApi.getComponents().getParameters(); final Map<String, Header> headers = openApi.getComponents().getHeaders(); final Map<String, Example> examples = openApi.getComponents().getExamples(); final Map<String, Link> links = openApi.getComponents().getLinks(); final Map<String, Callback> callbacks = openApi.getComponents().getCallbacks(); final Map<String, SecurityScheme> securitySchemes = openApi.getComponents().getSecuritySchemes(); if (responses != null) { Set<String> keySet = new LinkedHashSet<>(); while(responses.keySet().size() > keySet.size()) { processResponses(keySet, responses); } } if (requestBodies != null) { Set<String> keySet = new LinkedHashSet<>(); while(requestBodies.keySet().size() > keySet.size()) { processRequestBodies(keySet, requestBodies); } } if (parameters != null) { Set<String> keySet = new LinkedHashSet<>(); while(parameters.keySet().size() > keySet.size()) { processParameters(keySet, parameters); } } if (headers != null) { Set<String> keySet = new LinkedHashSet<>(); while(headers.keySet().size() > keySet.size()) { processHeaders(keySet, headers); } } if (examples != null) { Set<String> keySet = new LinkedHashSet<>(); while(examples.keySet().size() > keySet.size()) { processExamples(keySet, examples); } } if (links != null) { Set<String> keySet = new LinkedHashSet<>(); while(links.keySet().size() > keySet.size()) { processLinks(keySet, links); } } if (callbacks != null) { Set<String> keySet = new LinkedHashSet<>(); while(callbacks.keySet().size() > keySet.size()) { processCallbacks(keySet, callbacks); } } if (securitySchemes != null) { Set<String> keySet = new LinkedHashSet<>(); while(securitySchemes.keySet().size() > keySet.size()) { processSecuritySchemes(keySet, securitySchemes); } } final Map<String, Schema> schemas = openApi.getComponents().getSchemas(); if (schemas != null) { Set<String> keySet = new LinkedHashSet<>(); while(schemas.keySet().size() > keySet.size()) { processSchemas(keySet, schemas); } } } ComponentsProcessor(OpenAPI openApi,ResolverCache cache); void processComponents(); void processSchemas(Set<String> schemaKeys, Map<String, Schema> schemas); }
ComponentsProcessor { public void processComponents() { if (openApi.getComponents() == null){ return; } final Map<String, ApiResponse> responses = openApi.getComponents().getResponses(); final Map<String, RequestBody> requestBodies = openApi.getComponents().getRequestBodies(); final Map<String, Parameter> parameters = openApi.getComponents().getParameters(); final Map<String, Header> headers = openApi.getComponents().getHeaders(); final Map<String, Example> examples = openApi.getComponents().getExamples(); final Map<String, Link> links = openApi.getComponents().getLinks(); final Map<String, Callback> callbacks = openApi.getComponents().getCallbacks(); final Map<String, SecurityScheme> securitySchemes = openApi.getComponents().getSecuritySchemes(); if (responses != null) { Set<String> keySet = new LinkedHashSet<>(); while(responses.keySet().size() > keySet.size()) { processResponses(keySet, responses); } } if (requestBodies != null) { Set<String> keySet = new LinkedHashSet<>(); while(requestBodies.keySet().size() > keySet.size()) { processRequestBodies(keySet, requestBodies); } } if (parameters != null) { Set<String> keySet = new LinkedHashSet<>(); while(parameters.keySet().size() > keySet.size()) { processParameters(keySet, parameters); } } if (headers != null) { Set<String> keySet = new LinkedHashSet<>(); while(headers.keySet().size() > keySet.size()) { processHeaders(keySet, headers); } } if (examples != null) { Set<String> keySet = new LinkedHashSet<>(); while(examples.keySet().size() > keySet.size()) { processExamples(keySet, examples); } } if (links != null) { Set<String> keySet = new LinkedHashSet<>(); while(links.keySet().size() > keySet.size()) { processLinks(keySet, links); } } if (callbacks != null) { Set<String> keySet = new LinkedHashSet<>(); while(callbacks.keySet().size() > keySet.size()) { processCallbacks(keySet, callbacks); } } if (securitySchemes != null) { Set<String> keySet = new LinkedHashSet<>(); while(securitySchemes.keySet().size() > keySet.size()) { processSecuritySchemes(keySet, securitySchemes); } } final Map<String, Schema> schemas = openApi.getComponents().getSchemas(); if (schemas != null) { Set<String> keySet = new LinkedHashSet<>(); while(schemas.keySet().size() > keySet.size()) { processSchemas(keySet, schemas); } } } ComponentsProcessor(OpenAPI openApi,ResolverCache cache); void processComponents(); void processSchemas(Set<String> schemaKeys, Map<String, Schema> schemas);  }