use of com.thinkbiganalytics.metadata.rest.model.sla.ServiceLevelAssessment in project kylo by Teradata.
the class MetadataClientTest method testCheckPrecondition.
// @Test
public void testCheckPrecondition() throws ParseException {
Feed feedA = buildFeed("category", "feedA").post();
Feed feedB = buildFeed("category", "feedB", "category", "feedA").post();
HiveTableDatasource dsA = buildHiveTableDatasource("test-table").post();
feedA = client.addDestination(feedA.getId(), dsA.getId());
String destIdA = feedA.getDestinations().iterator().next().getId();
DataOperation op = client.beginOperation(destIdA, "");
op.setState(State.SUCCESS);
op.setDataset(new Dataset(new DateTime(), dsA, ChangeType.UPDATE, ContentType.PARTITIONS));
op = client.updateDataOperation(op);
ServiceLevelAssessment assmt = client.assessPrecondition(feedB.getId());
assertThat(assmt).isNotNull();
}
use of com.thinkbiganalytics.metadata.rest.model.sla.ServiceLevelAssessment in project kylo by Teradata.
the class IntegrationTestBase method getServiceLevelAssessments.
protected ServiceLevelAssessment[] getServiceLevelAssessments(String filter) {
LOG.info(String.format("Getting up to 50 SLA Assessments for filter %s", filter));
Response response = given(ServiceLevelAssessmentsController.BASE).urlEncodingEnabled(// url encoding enabled false to avoid replacing percent symbols in url query part
false).when().get("?filter=" + filter + "&limit=50&sort=-createdTime&start=0");
response.then().statusCode(HTTP_OK);
SearchResult<Object> result = response.as(SearchResultImpl.class);
final ObjectMapper mapper = new ObjectMapper();
return result.getData().stream().map(o -> mapper.convertValue(o, ServiceLevelAssessment.class)).toArray(ServiceLevelAssessment[]::new);
}
Aggregations