@Test public void handleMethodAnnotationShouldSetParamsTypeAndName() throws Exception { when(mockMethodConfigBuilder.startExtraParamConfig()).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.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockMethodConfigBuilder).startExtraParamConfig(); verify(mockParamConfigBuilder).setType(ParamType.FORM); verify(mockParamConfigBuilder).setName("a"); verify(mockParamConfigBuilder).setDefaultValue(null); verify(mockAnnotation).value(); verify(mockAnnotation).defaultValue(); }
@Override public void handleMethodAnnotation(FormParam annotation, MethodConfigBuilder builder) { builder.startExtraParamConfig() .setType(FORM) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); }
FormParamAnnotationHandler extends ParamAnnotationHandler<FormParam> { @Override public void handleMethodAnnotation(FormParam annotation, MethodConfigBuilder builder) { builder.startExtraParamConfig() .setType(FORM) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } }
FormParamAnnotationHandler extends ParamAnnotationHandler<FormParam> { @Override public void handleMethodAnnotation(FormParam annotation, MethodConfigBuilder builder) { builder.startExtraParamConfig() .setType(FORM) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } FormParamAnnotationHandler(CRestConfig crestConfig); }
FormParamAnnotationHandler extends ParamAnnotationHandler<FormParam> { @Override public void handleMethodAnnotation(FormParam annotation, MethodConfigBuilder builder) { builder.startExtraParamConfig() .setType(FORM) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } FormParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(FormParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(FormParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(FormParam annotation, ParamConfigBuilder builder); }
FormParamAnnotationHandler extends ParamAnnotationHandler<FormParam> { @Override public void handleMethodAnnotation(FormParam annotation, MethodConfigBuilder builder) { builder.startExtraParamConfig() .setType(FORM) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } FormParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(FormParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(FormParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(FormParam annotation, ParamConfigBuilder builder);  }