DescribeQueryServiceFunction extends CliFunction { QueryConfigService translateQueryServiceObjectIntoQueryConfigService( QueryConfigurationServiceImpl queryServiceObject) { QueryConfigService queryConfigService = new QueryConfigService(); MethodInvocationAuthorizer methodAuthorizer = queryServiceObject.getMethodAuthorizer(); if (methodAuthorizer != null) { QueryConfigService.MethodAuthorizer methodAuthorizerConfig = new QueryConfigService.MethodAuthorizer(); methodAuthorizerConfig.setClassName(methodAuthorizer.getClass().getName()); queryConfigService.setMethodAuthorizer(methodAuthorizerConfig); } return queryConfigService; }  @Override CliFunctionResult executeFunction(FunctionContext context);  }
@Test public void translateQueryServiceObjectIntoQueryConfigServiceReturnsCorrectlyPopulatedObject() { QueryConfigService queryConfigService = function.translateQueryServiceObjectIntoQueryConfigService(mockQueryServiceObject); assertThat(queryConfigService.getMethodAuthorizer().getClassName()) .isEqualTo(mockAuthorizer.getClass().getName()); }