Search in sources :

Example 1 with TransJobEntryAnalyzer

use of org.pentaho.metaverse.analyzer.kettle.jobentry.transjob.TransJobEntryAnalyzer in project pentaho-metaverse by pentaho.

the class AnalyzerInfoServiceTest method testGetSupportedEntries.

@Test
public void testGetSupportedEntries() throws Exception {
    List<IJobEntryAnalyzer> analyzers = new ArrayList<>();
    final TransJobEntryAnalyzer transJobEntryAnalyzer = new TransJobEntryAnalyzer();
    analyzers.add(transJobEntryAnalyzer);
    when(jobEntryAnalyzerProvider.getAnalyzers()).thenReturn(analyzers);
    Response supportedJobEntries = service.getSupportedJobEntries();
    assertEquals(Response.Status.OK.getStatusCode(), supportedJobEntries.getStatus());
    assertNotNull(supportedJobEntries.getEntity());
    assertTrue(supportedJobEntries.getEntity() instanceof List);
    List<AnalyzerInfo> responseList = (List<AnalyzerInfo>) supportedJobEntries.getEntity();
    assertEquals(analyzers.size(), responseList.size());
    // should be sorted based on meta name
    assertEquals(transJobEntryAnalyzer.getSupportedEntries().iterator().next().getSimpleName(), responseList.get(0).getMeta());
}
Also used : Response(javax.ws.rs.core.Response) TransJobEntryAnalyzer(org.pentaho.metaverse.analyzer.kettle.jobentry.transjob.TransJobEntryAnalyzer) IJobEntryAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.jobentry.IJobEntryAnalyzer) 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 TransJobEntryAnalyzer (org.pentaho.metaverse.analyzer.kettle.jobentry.transjob.TransJobEntryAnalyzer)1 IJobEntryAnalyzer (org.pentaho.metaverse.api.analyzer.kettle.jobentry.IJobEntryAnalyzer)1