@Test public void handleInterfaceAnnotationShouldSetParamsTypeAndName() throws Exception { when(mockInterfaceConfigBuilder.startMethodsExtraParamConfig()).thenReturn(mockParamConfigBuilder); when(mockParamConfigBuilder.setType(any(ParamType.class))).thenReturn(mockParamConfigBuilder); when(mockParamConfigBuilder.setName(any(String.class))).thenReturn(mockParamConfigBuilder); when(mockAnnotation.value()).thenReturn("a"); when(mockAnnotation.defaultValue()).thenReturn(""); toTest.handleInterfaceAnnotation(mockAnnotation, mockInterfaceConfigBuilder); verify(mockInterfaceConfigBuilder).startMethodsExtraParamConfig(); verify(mockParamConfigBuilder).setType(ParamType.QUERY); verify(mockParamConfigBuilder).setName("a"); verify(mockParamConfigBuilder).setDefaultValue(null); verify(mockAnnotation).value(); verify(mockAnnotation).defaultValue(); }
@Override public void handleInterfaceAnnotation(QueryParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(QUERY) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); }
QueryParamAnnotationHandler extends ParamAnnotationHandler<QueryParam> { @Override public void handleInterfaceAnnotation(QueryParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(QUERY) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } }
QueryParamAnnotationHandler extends ParamAnnotationHandler<QueryParam> { @Override public void handleInterfaceAnnotation(QueryParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(QUERY) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } QueryParamAnnotationHandler(CRestConfig crestConfig); }
QueryParamAnnotationHandler extends ParamAnnotationHandler<QueryParam> { @Override public void handleInterfaceAnnotation(QueryParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(QUERY) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } QueryParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(QueryParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(QueryParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(QueryParam annotation, ParamConfigBuilder builder); }
QueryParamAnnotationHandler extends ParamAnnotationHandler<QueryParam> { @Override public void handleInterfaceAnnotation(QueryParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(QUERY) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } QueryParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(QueryParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(QueryParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(QueryParam annotation, ParamConfigBuilder builder);  }