public @Nonnull AclTrace getTrace() { return new AclTrace( ImmutableList.copyOf( Traverser.forTree(TraceEventNode::getChildren).depthFirstPreOrder(_traceRoot)) .stream() .map(TraceEventNode::getEvent) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList())); }
@Override protected List<TraceEvent> featureValueOf(AclTrace actual) { return actual.getEvents(); } }
@Test public void testColumnComparatorAclTrace() { String col = "col1"; ColumnMetadata columnMetadata = new ColumnMetadata(col, Schema.ACL_TRACE, "colDesc"); Comparator<Row> comparator = _manager.columnComparator(columnMetadata); Row r1 = Row.of(col, new AclTrace(ImmutableList.of(new DefaultDeniedByIpAccessList("a", "a", "a")))); Row r2 = Row.of(col, new AclTrace(ImmutableList.of(new DefaultDeniedByIpAccessList("b", "b", "b")))); assertThat(comparator.compare(r1, r2), lessThan(0)); }