use of io.engineblock.activityapi.cyclelog.filters.ResultFilterDispenser in project engineblock by engineblock.
the class CoreResultFilterTest method testComponentLifecycle.
@Test
public void testComponentLifecycle() {
ResultValueFilterType filterType = CoreResultValueFilter.FINDER.get("core").orElseThrow(() -> new RuntimeException("Unable to find " + ResultValueFilterType.class.getSimpleName() + " for 'core'"));
ResultFilterDispenser fd = filterType.getDispenser("in:5,ex:6,in:7");
Predicate<ResultReadable> cycleResultFilter = fd.getResultFilter();
assertThat(cycleResultFilter.test(new SimpleCycleResult(3, 3))).isFalse();
assertThat(cycleResultFilter.test(new SimpleCycleResult(3, 5))).isTrue();
assertThat(cycleResultFilter.test(new SimpleCycleResult(3, 6))).isFalse();
assertThat(cycleResultFilter.test(new SimpleCycleResult(3, 7))).isTrue();
assertThat(cycleResultFilter.test(new SimpleCycleResult(3, 8))).isFalse();
}
Aggregations