use of org.talend.dataquality.semantic.broadcast.TdqCategories in project data-prep by Talend.
the class TransformAPITest method retrieveDictionary.
@Test
public void retrieveDictionary() throws Exception {
// when
final InputStream dictionary = given().when().expect().statusCode(200).log().ifError().get("/api/transform/dictionary").asInputStream();
// then
final ObjectInputStream ois = new ObjectInputStream(new GZIPInputStream(dictionary));
final Object object = ois.readObject();
Assert.assertEquals(TdqCategories.class, object.getClass());
final TdqCategories serviceDictionary = (TdqCategories) object;
// Test Lucene directory
final Directory dictionaryDirectory = serviceDictionary.getDictionary().asDirectory();
// creation.
assertNotNull(dictionaryDirectory);
// Test Lucene directory
final Directory keywordDirectory = serviceDictionary.getKeyword().asDirectory();
// creation.
assertNotNull(keywordDirectory);
}
Aggregations