use of jetbrains.buildServer.server.rest.util.fieldInclusion.FieldStrategy in project teamcity-rest by JetBrains.
the class TestOccurrence method getInvocations.
@XmlElement
@FieldStrategy(name = "invocations", defaultForShort = FieldRule.EXCLUDE, defaultForLong = FieldRule.EXCLUDE)
public TestOccurrences getInvocations() {
return ValueWithDefault.decideDefault(myChecker.isIncluded("invocations", myFields), () -> {
if (!(myTestRun instanceof MultiTestRun))
return null;
MultiTestRun multiTestRun = (MultiTestRun) myTestRun;
Fields nestedField = myFields.getNestedField("invocations");
PagingItemFilter<STestRun> pagingFilter = myTestOccurrenceFinder.getPagingInvocationsFilter(nestedField);
FilterItemProcessor<STestRun> processor = new FilterItemProcessor<>(pagingFilter);
multiTestRun.getTestRuns().forEach(processor::processItem);
ArrayList<STestRun> filtered = processor.getResult();
return new TestOccurrences(filtered, null, null, null, nestedField, myBeanContext);
});
}
Aggregations