Search in sources :

Example 1 with ResultFilterDispenser

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();
}
Also used : ResultFilterDispenser(io.engineblock.activityapi.cyclelog.filters.ResultFilterDispenser) SimpleCycleResult(io.engineblock.activityapi.cyclelog.outputs.SimpleCycleResult) ResultValueFilterType(io.engineblock.activityapi.cyclelog.filters.ResultValueFilterType) ResultReadable(io.engineblock.activityapi.cyclelog.buffers.results.ResultReadable) Test(org.testng.annotations.Test)

Aggregations

ResultReadable (io.engineblock.activityapi.cyclelog.buffers.results.ResultReadable)1 ResultFilterDispenser (io.engineblock.activityapi.cyclelog.filters.ResultFilterDispenser)1 ResultValueFilterType (io.engineblock.activityapi.cyclelog.filters.ResultValueFilterType)1 SimpleCycleResult (io.engineblock.activityapi.cyclelog.outputs.SimpleCycleResult)1 Test (org.testng.annotations.Test)1