Search in sources :

Example 1 with MergeJoinStepAnalyzer

use of org.pentaho.metaverse.analyzer.kettle.step.mergejoin.MergeJoinStepAnalyzer 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());
}
Also used : IStepAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.step.IStepAnalyzer) Response(javax.ws.rs.core.Response) StringsCutStepAnalyzer(org.pentaho.metaverse.analyzer.kettle.step.stringscut.StringsCutStepAnalyzer) MergeJoinStepAnalyzer(org.pentaho.metaverse.analyzer.kettle.step.mergejoin.MergeJoinStepAnalyzer) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Response (javax.ws.rs.core.Response)1 Test (org.junit.Test)1 MergeJoinStepAnalyzer (org.pentaho.metaverse.analyzer.kettle.step.mergejoin.MergeJoinStepAnalyzer)1 StringsCutStepAnalyzer (org.pentaho.metaverse.analyzer.kettle.step.stringscut.StringsCutStepAnalyzer)1 IStepAnalyzer (org.pentaho.metaverse.api.analyzer.kettle.step.IStepAnalyzer)1