@Test public void handleInterfaceAnnotationShouldSetParamsTypeAndNameAndDefaultValue() 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("b"); toTest.handleInterfaceAnnotation(mockAnnotation, mockInterfaceConfigBuilder); verify(mockInterfaceConfigBuilder).startMethodsExtraParamConfig(); verify(mockParamConfigBuilder).setType(ParamType.MATRIX); verify(mockParamConfigBuilder).setName("a"); verify(mockParamConfigBuilder).setDefaultValue("b"); verify(mockAnnotation).value(); verify(mockAnnotation).defaultValue(); }
@Override public void handleInterfaceAnnotation(MatrixParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(MATRIX) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); }
MatrixParamAnnotationHandler extends ParamAnnotationHandler<MatrixParam> { @Override public void handleInterfaceAnnotation(MatrixParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(MATRIX) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } }
MatrixParamAnnotationHandler extends ParamAnnotationHandler<MatrixParam> { @Override public void handleInterfaceAnnotation(MatrixParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(MATRIX) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } MatrixParamAnnotationHandler(CRestConfig crestConfig); }
MatrixParamAnnotationHandler extends ParamAnnotationHandler<MatrixParam> { @Override public void handleInterfaceAnnotation(MatrixParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(MATRIX) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } MatrixParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(MatrixParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(MatrixParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(MatrixParam annotation, ParamConfigBuilder builder); }
MatrixParamAnnotationHandler extends ParamAnnotationHandler<MatrixParam> { @Override public void handleInterfaceAnnotation(MatrixParam annotation, InterfaceConfigBuilder builder) { builder.startMethodsExtraParamConfig() .setType(MATRIX) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } MatrixParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(MatrixParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(MatrixParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(MatrixParam annotation, ParamConfigBuilder builder);  }