@Test
public void should_fail_if_tag_is_not_valid() {
throwable.expect(IllegalArgumentException.class);
throwable.expectMessage("Tag 'th ag' is invalid. Rule tags accept only the characters: a-z, 0-9, '+', '-', '#', '.'");
Map<String, Object> properties = newHashMap();
properties.put("tags", "th ag");
DefaultIssue issue = mock(DefaultIssue.class);
when(issue.tags()).thenReturn(ImmutableSet.of("tag1", "tag3"));
Action.Context context = mock(Action.Context.class);
when(context.issue()).thenReturn(issue);
action.execute(properties, context);
}
}