Search in sources :

Example 6 with DefaultExecutedJob

use of com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob in project kylo by Teradata.

the class IntegrationTestBase method getJobs.

protected DefaultExecutedJob[] getJobs(String filter) {
    Response response = given(JobsRestController.BASE).urlEncodingEnabled(// url encoding enabled false to avoid replacing percent symbols in url query part
    false).when().get("?filter=" + filter + "&limit=50&sort=-createTime&start=0");
    response.then().statusCode(HTTP_OK);
    return JsonPath.from(response.asString()).getObject("data", DefaultExecutedJob[].class);
}
Also used : Response(com.jayway.restassured.response.Response) DefaultExecutedJob(com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob)

Example 7 with DefaultExecutedJob

use of com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob in project kylo by Teradata.

the class FeedIT method assertExecutedJobs.

public void assertExecutedJobs(String feedName, String feedId) throws IOException {
    LOG.info("Asserting there are 2 completed jobs: userdata ingest job, index text service system jobs");
    DefaultExecutedJob[] jobs = getJobs();
    // TODO assert all executed jobs are successful
    DefaultExecutedJob ingest = Arrays.stream(jobs).filter(job -> ("functional_tests." + feedName.toLowerCase()).equals(job.getFeedName())).findFirst().get();
    Assert.assertEquals(ExecutionStatus.COMPLETED, ingest.getStatus());
    Assert.assertEquals(ExitStatus.COMPLETED.getExitCode(), ingest.getExitCode());
    LOG.info("Asserting user data jobs has expected number of steps");
    DefaultExecutedJob job = getJobWithSteps(ingest.getExecutionId());
    Assert.assertEquals(ingest.getExecutionId(), job.getExecutionId());
    List<ExecutedStep> steps = job.getExecutedSteps();
    Assert.assertEquals(21, steps.size());
    for (ExecutedStep step : steps) {
        Assert.assertEquals(ExitStatus.COMPLETED.getExitCode(), step.getExitCode());
    }
    LOG.info("Asserting number of total/valid/invalid rows");
    Assert.assertEquals(1000, getTotalNumberOfRecords(feedId));
    Assert.assertEquals(VALID_RESULTS, getNumberOfValidRecords(feedId));
    Assert.assertEquals(121, getNumberOfInvalidRecords(feedId));
    assertValidatorsAndStandardisers(feedId, feedName);
    // TODO assert data via global search
    assertHiveData(feedName);
}
Also used : DefaultExecutedJob(com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob) ExecutedStep(com.thinkbiganalytics.jobrepo.query.model.ExecutedStep)

Aggregations

DefaultExecutedJob (com.thinkbiganalytics.jobrepo.query.model.DefaultExecutedJob)7 Response (com.jayway.restassured.response.Response)2 ExecutedStep (com.thinkbiganalytics.jobrepo.query.model.ExecutedStep)2 OpsManagerFeed (com.thinkbiganalytics.metadata.api.feed.OpsManagerFeed)1