use of org.apache.maven.plugins.changes.IssueAdapter in project maven-plugins by apache.
the class IssueAdapterTest method testCustomIssueTypeMapping.
public void testCustomIssueTypeMapping() {
IssueManagementSystem ims = new JIRAIssueManagmentSystem();
ims.getIssueTypeMap().put("Story", IssueType.ADD);
ims.getIssueTypeMap().put("Epic", IssueType.ADD);
ims.getIssueTypeMap().put("Defect", IssueType.FIX);
ims.getIssueTypeMap().put("Error", IssueType.FIX);
IssueAdapter adapter = new IssueAdapter(ims);
Issue issue = createIssue("TST-1", "Story");
Action action = adapter.createAction(issue);
assertEquals("add", action.getType());
issue = createIssue("TST-2", "Epic");
action = adapter.createAction(issue);
assertEquals("add", action.getType());
issue = createIssue("TST-3", "Error");
action = adapter.createAction(issue);
assertEquals("fix", action.getType());
issue = createIssue("TST-4", "Defect");
action = adapter.createAction(issue);
assertEquals("fix", action.getType());
// Test the default mapping for "update" hasn't been overridden
issue = createIssue("TST-5", "Improvement");
action = adapter.createAction(issue);
assertEquals("update", action.getType());
}
use of org.apache.maven.plugins.changes.IssueAdapter in project maven-plugins by apache.
the class IssueAdapterTest method testCustomIssueTypeMappingOveridesDefaultMapping.
public void testCustomIssueTypeMappingOveridesDefaultMapping() {
IssueManagementSystem ims = new JIRAIssueManagmentSystem();
ims.getIssueTypeMap().clear();
IssueAdapter adapter = new IssueAdapter(ims);
Issue issue = createIssue("TST-1", "New Feature");
Action action = adapter.createAction(issue);
assertEquals("", action.getType());
issue = createIssue("TST-2", "Bug");
action = adapter.createAction(issue);
assertEquals("", action.getType());
issue = createIssue("TST-3", "Improvement");
action = adapter.createAction(issue);
assertEquals("", action.getType());
issue = createIssue("TST-4", "Unknown Type");
action = adapter.createAction(issue);
assertEquals("", action.getType());
}
use of org.apache.maven.plugins.changes.IssueAdapter in project maven-plugins by apache.
the class IssueAdapterTest method testDefaultIssueTypeMapping.
public void testDefaultIssueTypeMapping() {
IssueAdapter adapter = new IssueAdapter(new JIRAIssueManagmentSystem());
Issue issue = createIssue("TST-1", "New Feature");
Action action = adapter.createAction(issue);
assertEquals("add", action.getType());
issue = createIssue("TST-2", "Bug");
action = adapter.createAction(issue);
assertEquals("fix", action.getType());
issue = createIssue("TST-3", "Improvement");
action = adapter.createAction(issue);
assertEquals("update", action.getType());
issue = createIssue("TST-4", "Unknown Type");
action = adapter.createAction(issue);
assertEquals("", action.getType());
}
Aggregations