@Override @CheckReturnValue public SELF as(Description description) { return super.as(description); }
@Override @CheckReturnValue public SELF as(String description, Object... args) { return super.as(description, args); }
@Override @CheckReturnValue public SELF as(Description description) { return super.as(description); }
@Override @CheckReturnValue public SELF as(String description, Object... args) { return super.as(description, args); }
/** * Assert that the branch is tagged with the given tags (possibly among others) * @param tags tag names * @return fluent API */ public BranchResponseAssert isTagged(String... tags) { Set<String> tagNames = actual.getTags().stream().map(TagReference::getName).collect(Collectors.toSet()); assertThat(tagNames).as(descriptionText() + " tags").contains(tags); return this; }
/** * Assert that the branch is only tagged with the given tags * @param tags tag names * @return fluent API */ public BranchResponseAssert isOnlyTagged(String... tags) { Set<String> tagNames = actual.getTags().stream().map(TagReference::getName).collect(Collectors.toSet()); assertThat(tagNames).as(descriptionText() + " tags").containsOnly(tags); return this; } }
/** * Assert that the branch is not tagged with any of the given tags * @param tags tag names * @return fluent API */ public BranchResponseAssert isNotTagged(String... tags) { Set<String> tagNames = actual.getTags().stream().map(TagReference::getName).collect(Collectors.toSet()); assertThat(tagNames).as(descriptionText() + " tags").doesNotContain(tags); return this; }
/** * Assert that the branch is not tagged with any of the given tags * @param tags tag names * @return fluent API */ public BranchAssert isNotTagged(String... tags) { Set<String> tagNames = actual.getTags().stream().map(Tag::getName).collect(Collectors.toSet()); assertThat(tagNames).as(descriptionText() + " tags").doesNotContain(tags); return this; }
/** * Assert that the branch is tagged with the given tags (possibly among others) * @param tags tag names * @return fluent API */ public BranchAssert isTagged(String... tags) { Set<String> tagNames = actual.getTags().stream().map(Tag::getName).collect(Collectors.toSet()); assertThat(tagNames).as(descriptionText() + " tags").contains(tags); return this; }
/** * Assert that the branch is only tagged with the given tags * @param tags tag names * @return fluent API */ public BranchAssert isOnlyTagged(String... tags) { Set<String> tagNames = actual.getTags().stream().map(Tag::getName).collect(Collectors.toSet()); assertThat(tagNames).as(descriptionText() + " tags").containsOnly(tags); return this; } }
public void assertNoEvents() { assertThat(events).as("Unconsumed events found!").isEmpty(); }
/** * Assert that the field container has no next container * * @param container * @return fluent API */ public NodeGraphFieldContainerAssert isLast() { assertThat(actual.getNextVersions()).as(descriptionText() + " next container").isEmpty(); return this; }
/** * Checks the existence of a symbol at the specified location. * @param line the line of the symbol * @param column any column of the symbol */ public void checkSymbolExistence(SensorContextTester context, int line, int column) { Collection<TextRange> foundReferences = context.referencesForSymbolAt(componentKey, line, column); String message = "a symbol is expected to exist and have references at line " + line + " and column " + column; assertThat(foundReferences).as(message).isNotNull(); }
public void checkNoSymbolExists(SensorContextTester context, int line, int column) { Collection<TextRange> foundReferences = context.referencesForSymbolAt(componentKey, line, column); String message = "no symbol is expected to exist at line " + line + " and column " + column; assertThat(foundReferences).as(message).isNull(); }
/** * Assert that the field container has the given next container * * @param container * @return fluent API */ public NodeGraphFieldContainerAssert hasNext(NodeGraphFieldContainer container) { Iterable<NodeGraphFieldContainer> next = (Iterable<NodeGraphFieldContainer>) actual.getNextVersions(); assertThat(next).as(descriptionText() + " next container").isNotNull().usingFieldByFieldElementComparator().contains(container); return this; }
/** * Assert that the node has none of the given nodes as children in the branch. * * @param branch * branch * @param nodes * list of nodes * @return fluent API */ public NodeAssert hasNotChildren(Branch branch, Node... nodes) { assertThat(actual.getChildren(branch.getUuid())).as(descriptionText() + " children").usingElementComparatorOnFields("uuid").doesNotContain( nodes); return this; }
@Test public void testLegacyIdCorrectlyAnnotated() { ThriftStructMetadataBuilder builder = new ThriftStructMetadataBuilder(new ThriftCatalog(), LegacyIdCorrect.class); ThriftStructMetadata metadata = builder.build(); Set<Integer> seen = new HashSet<>(); for (ThriftFieldMetadata field : metadata.getFields()) { seen.add((int) field.getId()); } assertThat(seen) .as("fields found in LegacyIdCorrect") .isEqualTo(LegacyIdCorrect.IDS); }
@Test public void testLegacyIdOnUnion() { ThriftUnionMetadataBuilder builder = new ThriftUnionMetadataBuilder(new ThriftCatalog(), LegacyIdUnionCorrect.class); ThriftStructMetadata metadata = builder.build(); Set<Integer> seen = new HashSet<>(); for (ThriftFieldMetadata field : metadata.getFields()) { seen.add((int) field.getId()); } assertThat(seen) .as("fields found in LegacyIdUnionCorrect") .isEqualTo(LegacyIdUnionCorrect.IDS); }
@Test public void testLegacyIdOnUnion() { ThriftUnionMetadataBuilder builder = new ThriftUnionMetadataBuilder(new ThriftCatalog(), LegacyIdUnionCorrect.class); ThriftStructMetadata metadata = builder.build(); Set<Integer> seen = new HashSet<>(); for (ThriftFieldMetadata field : metadata.getFields()) { seen.add((int) field.getId()); } assertThat(seen) .as("fields found in LegacyIdUnionCorrect") .isEqualTo(LegacyIdUnionCorrect.IDS); }
@Test public void testLegacyIdCorrectlyAnnotated() { ThriftStructMetadataBuilder builder = new ThriftStructMetadataBuilder(new ThriftCatalog(), LegacyIdCorrect.class); ThriftStructMetadata metadata = builder.build(); Set<Integer> seen = new HashSet<>(); for (ThriftFieldMetadata field : metadata.getFields()) { seen.add((int) field.getId()); } assertThat(seen) .as("fields found in LegacyIdCorrect") .isEqualTo(LegacyIdCorrect.IDS); }