Skip to content

Command line argument --wanted-tags=_ imports all items #432

@kaklakariada

Description

@kaklakariada

Description

When running OFT with command line argument --wanted-tags=_ it imports all specification items

Steps to Reproduce

  1. Create a spec item a with tag "tagA" and one item b without tags
  2. Run OFT with --wanted-tags=_

Expected behavior

OFT imports only the item b

Environment

  • OFT: 4.1.0

Additional context

Failing test case for TestSpecificationListBuilder reproducing the bug:

    @Test
    void testFilterSpecificationItemsByTagsOnlyWithoutTag()
    {
        final FilterSettings filterSettings = FilterSettings.builder() //
                .tags(emptySet()) //
                .withoutTags(true) //
                .build();
        final SpecificationListBuilder builder = SpecificationListBuilder
                .createWithFilter(filterSettings);
        addItemWithTags(builder, "out-A", "client", "database");
        addItemWithTags(builder, "out-B", "server", "database");
        addItemWithTags(builder, "out-C", "exporter", "database");
        addItemWithTags(builder, "in-D");
        final List<SpecificationItem> items = builder.build();
        assertThat(items.stream().map(SpecificationItem::getName).collect(Collectors.toList()),
                containsInAnyOrder("in-D"));
    }

See also itsallcode/openfasttrace-maven-plugin@f9fbbed (#71)

Workaround

Specify any unused tag, e.g. --wanted-tags=_,unusedTag

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    📫 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions