@Test public void testContribute() { underTest.contribute(swagger); assertContributedMap(true); Parameter param = PARAMS.iterator().next(); verify(getOperationPath1).addParameter(param); verify(postOperationPath1).addParameter(param); verify(getOperationPath2).addParameter(param); verify(postOperationPath2).addParameter(param); reset(getOperationPath1, postOperationPath1, getOperationPath2, postOperationPath2); underTest.contribute(swagger); verify(getOperationPath1, never()).addParameter(param); verify(postOperationPath1, never()).addParameter(param); verify(getOperationPath2, never()).addParameter(param); verify(postOperationPath2, never()).addParameter(param); }
@Override public void contribute(final Swagger swagger) { if (allContributed) { return; } for (HttpMethod httpMethod : httpMethods) { for (String path : paths) { contributed.compute(getKey(httpMethod, path), (key, value) -> value || contributeGetParameters(swagger, httpMethod, path, params)); } } allContributed = contributed.entrySet().stream().allMatch(Entry::getValue); }
ParameterContributor extends ComponentSupport implements SwaggerContributor { @Override public void contribute(final Swagger swagger) { if (allContributed) { return; } for (HttpMethod httpMethod : httpMethods) { for (String path : paths) { contributed.compute(getKey(httpMethod, path), (key, value) -> value || contributeGetParameters(swagger, httpMethod, path, params)); } } allContributed = contributed.entrySet().stream().allMatch(Entry::getValue); } }
ParameterContributor extends ComponentSupport implements SwaggerContributor { @Override public void contribute(final Swagger swagger) { if (allContributed) { return; } for (HttpMethod httpMethod : httpMethods) { for (String path : paths) { contributed.compute(getKey(httpMethod, path), (key, value) -> value || contributeGetParameters(swagger, httpMethod, path, params)); } } allContributed = contributed.entrySet().stream().allMatch(Entry::getValue); } ParameterContributor(final Collection<HttpMethod> httpMethods,
                              final Collection<String> paths,
                              final Collection<T> params); }
ParameterContributor extends ComponentSupport implements SwaggerContributor { @Override public void contribute(final Swagger swagger) { if (allContributed) { return; } for (HttpMethod httpMethod : httpMethods) { for (String path : paths) { contributed.compute(getKey(httpMethod, path), (key, value) -> value || contributeGetParameters(swagger, httpMethod, path, params)); } } allContributed = contributed.entrySet().stream().allMatch(Entry::getValue); } ParameterContributor(final Collection<HttpMethod> httpMethods,
                              final Collection<String> paths,
                              final Collection<T> params); @Override void contribute(final Swagger swagger); }
ParameterContributor extends ComponentSupport implements SwaggerContributor { @Override public void contribute(final Swagger swagger) { if (allContributed) { return; } for (HttpMethod httpMethod : httpMethods) { for (String path : paths) { contributed.compute(getKey(httpMethod, path), (key, value) -> value || contributeGetParameters(swagger, httpMethod, path, params)); } } allContributed = contributed.entrySet().stream().allMatch(Entry::getValue); } ParameterContributor(final Collection<HttpMethod> httpMethods,
                              final Collection<String> paths,
                              final Collection<T> params); @Override void contribute(final Swagger swagger);  }