use of org.pentaho.metaverse.analyzer.kettle.step.stringscut.StringsCutStepAnalyzer in project pentaho-metaverse by pentaho.
the class AnalyzerInfoServiceTest method testGetSupportedSteps.
@Test
public void testGetSupportedSteps() throws Exception {
List<IStepAnalyzer> analyzers = new ArrayList<>();
final StringsCutStepAnalyzer stringsCutStepAnalyzer = new StringsCutStepAnalyzer();
final MergeJoinStepAnalyzer mergeJoinStepAnalyzer = new MergeJoinStepAnalyzer();
analyzers.add(stringsCutStepAnalyzer);
analyzers.add(mergeJoinStepAnalyzer);
when(stepAnalyzerProvider.getAnalyzers()).thenReturn(analyzers);
Response supportedSteps = service.getSupportedSteps();
assertEquals(Response.Status.OK.getStatusCode(), supportedSteps.getStatus());
assertNotNull(supportedSteps.getEntity());
assertTrue(supportedSteps.getEntity() instanceof List);
List<AnalyzerInfo> responseList = (List<AnalyzerInfo>) supportedSteps.getEntity();
assertEquals(analyzers.size(), responseList.size());
// should be sorted based on meta name
assertEquals(mergeJoinStepAnalyzer.getSupportedSteps().iterator().next().getSimpleName(), responseList.get(0).getMeta());
assertEquals(stringsCutStepAnalyzer.getSupportedSteps().iterator().next().getSimpleName(), responseList.get(1).getMeta());
}
Aggregations