@Test public void testOtherOverrideBadPassAnnotationPass() throws Exception { ReadOnlySwaggerDecoration decoration = new ReadOnlySwaggerDecoration(); Operation operation = new Operation(); decoration.decorateOperation(operation, TestTypeAnnotationOperations.class.getMethod("test1"), emptyListIterator()); Assert.assertThat(operation.getVendorExtensions().keySet(), not(hasItems(SWAGGER_EXTENSION_READ_ONLY))); }
@Override public void decorateOperation(Operation operation, Method method, Iterator<SwaggerExtension> chain) { if(method.isAnnotationPresent(GET.class)) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } return; } KieServerEndpoint api = method.getAnnotation(KieServerEndpoint.class); if(api == null) { api = method.getDeclaringClass().getAnnotation(KieServerEndpoint.class); } if (api != null) { List<EndpointType> current = new ArrayList<>(asList(api.categories())); current.retainAll(valid); if(!current.isEmpty()) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); } } if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } }
ReadOnlySwaggerDecoration extends AbstractSwaggerExtension { @Override public void decorateOperation(Operation operation, Method method, Iterator<SwaggerExtension> chain) { if(method.isAnnotationPresent(GET.class)) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } return; } KieServerEndpoint api = method.getAnnotation(KieServerEndpoint.class); if(api == null) { api = method.getDeclaringClass().getAnnotation(KieServerEndpoint.class); } if (api != null) { List<EndpointType> current = new ArrayList<>(asList(api.categories())); current.retainAll(valid); if(!current.isEmpty()) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); } } if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } } }
ReadOnlySwaggerDecoration extends AbstractSwaggerExtension { @Override public void decorateOperation(Operation operation, Method method, Iterator<SwaggerExtension> chain) { if(method.isAnnotationPresent(GET.class)) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } return; } KieServerEndpoint api = method.getAnnotation(KieServerEndpoint.class); if(api == null) { api = method.getDeclaringClass().getAnnotation(KieServerEndpoint.class); } if (api != null) { List<EndpointType> current = new ArrayList<>(asList(api.categories())); current.retainAll(valid); if(!current.isEmpty()) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); } } if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } }  }
ReadOnlySwaggerDecoration extends AbstractSwaggerExtension { @Override public void decorateOperation(Operation operation, Method method, Iterator<SwaggerExtension> chain) { if(method.isAnnotationPresent(GET.class)) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } return; } KieServerEndpoint api = method.getAnnotation(KieServerEndpoint.class); if(api == null) { api = method.getDeclaringClass().getAnnotation(KieServerEndpoint.class); } if (api != null) { List<EndpointType> current = new ArrayList<>(asList(api.categories())); current.retainAll(valid); if(!current.isEmpty()) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); } } if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } }  @Override void decorateOperation(Operation operation, Method method, Iterator<SwaggerExtension> chain); }
ReadOnlySwaggerDecoration extends AbstractSwaggerExtension { @Override public void decorateOperation(Operation operation, Method method, Iterator<SwaggerExtension> chain) { if(method.isAnnotationPresent(GET.class)) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } return; } KieServerEndpoint api = method.getAnnotation(KieServerEndpoint.class); if(api == null) { api = method.getDeclaringClass().getAnnotation(KieServerEndpoint.class); } if (api != null) { List<EndpointType> current = new ArrayList<>(asList(api.categories())); current.retainAll(valid); if(!current.isEmpty()) { operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE); } } if (chain.hasNext()) { chain.next().decorateOperation(operation, method, chain); } }  @Override void decorateOperation(Operation operation, Method method, Iterator<SwaggerExtension> chain); static final String SWAGGER_EXTENSION_READ_ONLY; }