/** * 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 GraphQLObjectType createType() { Builder branchType = newObject().name(BRANCH_TYPE_NAME); interfaceTypeProvider.addCommonFields(branchType); // .name branchType.field(newFieldDefinition().name("name").type(GraphQLString)); // .migrated branchType.field(newFieldDefinition().name("migrated").type(GraphQLBoolean)); // .latest branchType.field(newFieldDefinition().name("latest").type(GraphQLBoolean)); // .schema branchType.field( newFieldDefinition().name("schema").description("Load schema by name or uuid.") .argument(createUuidArg("Uuid of the schema.")) .argument(createNameArg("Name of the schema.")) .type(new GraphQLTypeReference(SCHEMA_TYPE_NAME)) .dataFetcher(this::handleBranchSchema) .build() ); // .schemas branchType.field(newPagingFieldWithFetcher("schemas", "Load schemas assigned to this branch.", this::handleBranchSchemas, SCHEMA_PAGE_TYPE_NAME)); // .tags branchType.field(newFieldDefinition().name("tags").argument(createPagingArgs()).type(new GraphQLTypeReference(TAG_PAGE_TYPE_NAME)).dataFetcher(( env) -> { GraphQLContext gc = env.getContext(); Branch branch = env.getSource(); return branch.getTags(gc.getUser(), getPagingInfo(env)); })); return branchType.build(); }