### Question:
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);  }### Answer:
@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.QUERY); verify(mockParamConfigBuilder).setName("a"); verify(mockParamConfigBuilder).setDefaultValue("b"); verify(mockAnnotation).value(); verify(mockAnnotation).defaultValue(); }
@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(); }
@Test public void handleInterfaceAnnotationShouldMergePlaceholdersAndSetParamsTypeAndNameAndDefaultValue() 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(VAL_WITH_PH + "a"); when(mockAnnotation.defaultValue()).thenReturn(VAL_WITH_PH + "b"); toTest.handleInterfaceAnnotation(mockAnnotation, mockInterfaceConfigBuilder); verify(mockInterfaceConfigBuilder).startMethodsExtraParamConfig(); verify(mockParamConfigBuilder).setType(ParamType.QUERY); verify(mockParamConfigBuilder).setName(EXPECTED_MERGE_VAL + "a"); verify(mockParamConfigBuilder).setDefaultValue(EXPECTED_MERGE_VAL + "b"); verify(mockAnnotation).value(); verify(mockAnnotation).defaultValue(); }