Tags implements Iterable<Tag> { public static String fromKarateOptionsTags(List<String> tags) { if (tags == null || tags.isEmpty()) { return null; } return fromKarateOptionsTags(tags.toArray(new String[]{})); } Tags(Collection<Tag> in); @Override Iterator<Tag> iterator(); static Tags merge(List<Tag>... lists); boolean evaluate(String tagSelector); boolean contains(String tagText); List<String> getTags(); Collection<String> getTagKeys(); Map<String, List<String>> getTagValues(); Collection<Tag> getOriginal(); boolean anyOf(ScriptObjectMirror som); boolean allOf(ScriptObjectMirror som); boolean not(ScriptObjectMirror som); Values valuesFor(String name); static List<Map> toResultList(List<Tag> tags); static String fromKarateOptionsTags(List<String> tags); static String fromKarateOptionsTags(String... tags); static final Tags EMPTY; }
@Test public void testCucumberOptionsTagsConversion() { assertEquals("anyOf('@foo')", Tags.fromKarateOptionsTags("@foo")); assertEquals("anyOf('@foo','@bar')", Tags.fromKarateOptionsTags("@foo,@bar")); assertEquals("anyOf('@foo') && anyOf('@bar')", Tags.fromKarateOptionsTags("@foo", "@bar")); assertEquals("anyOf('@foo') && not('@bar')", Tags.fromKarateOptionsTags("@foo", "~@bar")); assertEquals("anyOf('@foo')", Tags.fromKarateOptionsTags("anyOf('@foo')")); }