TransformAPI extends APIService { @RequestMapping(value = "/api/transform/dictionary", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get current dictionary (as serialized object).", notes = "Returns a DQ dictionary serialized usin Java serialization and GZIP-ed.") @Timed public StreamingResponseBody getDictionary() { HystrixCommand<InputStream> dictionaryCommand = getCommand(DictionaryCommand.class); return CommandHelper.toStreaming(dictionaryCommand); }  @RequestMapping(value = "/api/transform/actions/column", method = RequestMethod.POST, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get all actions for a data set column.", notes = "Returns all actions for the given column.") @Timed Stream<ActionForm> columnActions(@ApiParam(value = "Optional column Metadata content as JSON") InputStream body); @RequestMapping(value = "/api/transform/suggest/column", method = RequestMethod.POST, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get suggested actions for a data set column.", notes = "Returns the suggested actions for the given column in decreasing order of likeness.") @Timed Stream<ActionForm> suggestColumnActions(@ApiParam(value = "Column Metadata content as JSON") InputStream body); @RequestMapping(value = "/api/transform/actions/line", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get all actions on line", notes = "Returns all actions for a line.") @Timed Stream<ActionForm> lineActions(); @RequestMapping(value = "/api/transform/actions/dataset", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get all actions the whole dataset.", notes = "Returns all actions for the whole dataset..") @Timed Stream<ActionForm> datasetActions(); @RequestMapping(value = "/api/transform/actions/multi_columns", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get all actions the selected columns.", notes = "Returns all actions for the selected columns..") @Timed Stream<ActionForm> multiColumnsActions(); @RequestMapping(value = "/api/transform/suggest/{action}/params", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get the transformation dynamic parameters", notes = "Returns the transformation parameters.") @Timed ResponseEntity<StreamingResponseBody> suggestActionParams(
            @ApiParam(value = "Transformation name.") @PathVariable("action") final String action, @ApiParam(
                    value = "Suggested dynamic transformation input (preparation id or dataset id") @Valid final DynamicParamsInput dynamicParamsInput); @RequestMapping(value = "/api/transform/dictionary", method = GET, produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Get current dictionary (as serialized object).", notes = "Returns a DQ dictionary serialized usin Java serialization and GZIP-ed.") @Timed StreamingResponseBody getDictionary();  }
@Test public void retrieveDictionary() throws Exception { final InputStream dictionary = given() .when() .expect() .statusCode(200) .log() .ifError() .get("/api/transform/dictionary") .asInputStream(); final ObjectInputStream ois = new ObjectInputStream(new GZIPInputStream(dictionary)); final Object object = ois.readObject(); Assert.assertEquals(TdqCategories.class, object.getClass()); final TdqCategories serviceDictionary = (TdqCategories) object; final Directory dictionaryDirectory = serviceDictionary.getDictionary().asDirectory(); assertNotNull(dictionaryDirectory); final Directory keywordDirectory = serviceDictionary.getKeyword().asDirectory(); assertNotNull(keywordDirectory); }