Search in sources :

Example 6 with FeedOnTimeArrivalMetric

use of com.thinkbiganalytics.metadata.sla.api.core.FeedOnTimeArrivalMetric in project kylo by Teradata.

the class FeedOnTimeArrivalMetricAssessorTest method setUp.

@Before
public void setUp() throws Exception {
    initMocks(this);
    when(this.builder.message(any(String.class))).thenReturn(this.builder);
    when(this.builder.metric(any(Metric.class))).thenReturn(this.builder);
    when(this.builder.result(any(AssessmentResult.class))).thenReturn(this.builder);
    this.assessor.setMetadataAccess(this.metadataAccess);
    // Noon every day
    CronExpression cron = new CronExpression("0 0 12 1/1 * ? *");
    this.lateTime = new DateTime(CronExpressionUtil.getPreviousFireTime(cron)).plusHours(4);
    this.metric = new FeedOnTimeArrivalMetric("feed", cron, Period.hours(lateTimeGracePeriod));
}
Also used : Metric(com.thinkbiganalytics.metadata.sla.api.Metric) FeedOnTimeArrivalMetric(com.thinkbiganalytics.metadata.sla.api.core.FeedOnTimeArrivalMetric) CronExpression(org.quartz.CronExpression) FeedOnTimeArrivalMetric(com.thinkbiganalytics.metadata.sla.api.core.FeedOnTimeArrivalMetric) AssessmentResult(com.thinkbiganalytics.metadata.sla.api.AssessmentResult) DateTime(org.joda.time.DateTime) Before(org.junit.Before)

Aggregations

FeedOnTimeArrivalMetric (com.thinkbiganalytics.metadata.sla.api.core.FeedOnTimeArrivalMetric)6 Test (org.junit.Test)5 DateTime (org.joda.time.DateTime)4 CronExpression (org.quartz.CronExpression)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 Predicate (com.google.common.base.Predicate)1 AssessmentResult (com.thinkbiganalytics.metadata.sla.api.AssessmentResult)1 Metric (com.thinkbiganalytics.metadata.sla.api.Metric)1 Before (org.junit.Before)1