use of com.intellij.tasks.CustomTaskState in project intellij-community by JetBrains.
the class YouTrackIntegrationTest method testCustomTaskStates.
public void testCustomTaskStates() throws Exception {
final Task task = myRepository.findTask(REQUEST_WITH_CUSTOM_STATES_ID);
assertNotNull(task);
final Set<CustomTaskState> states = myRepository.getAvailableTaskStates(task);
final List<String> stateNames = ContainerUtil.map(states, CustomTaskState::getPresentableName);
assertContainsElements(stateNames, "North", "South");
// IDEA-147006
assertDoesntContain(stateNames, "Peru State College", "The Evergreen State College");
// ? -> North
myRepository.setTaskState(task, NORTH_STATE);
Element element = myRepository.fetchRequestAsElement(REQUEST_WITH_CUSTOM_STATES_ID);
assertEquals("North", element.getAttributeValue("state"));
// North -> Submitted
myRepository.setTaskState(task, SUBMITTED_STATE);
element = myRepository.fetchRequestAsElement(REQUEST_WITH_CUSTOM_STATES_ID);
assertEquals("Submitted", element.getAttributeValue("state"));
}
use of com.intellij.tasks.CustomTaskState in project intellij-community by JetBrains.
the class TrelloIntegrationTest method testStateUpdates.
public void testStateUpdates() throws Exception {
TrelloCard card = myRepository.fetchCardById(FEATURE_CARD_ID);
assertNotNull(card);
assertEquals(STATE_UPDATES_BOARD_ID, card.getIdBoard());
assertEquals(BACKLOG_LIST_ID, card.getIdList());
// Discover "In Progress" list
TrelloTask task = new TrelloTask(card, myRepository);
Set<CustomTaskState> states = myRepository.getAvailableTaskStates(task);
assertEquals(1, states.size());
final CustomTaskState inProgressState = states.iterator().next();
assertEquals(IN_PROGRESS_LIST_ID, inProgressState.getId());
assertEquals("In Progress", inProgressState.getPresentableName());
// Backlog -> In Progress
myRepository.setTaskState(task, inProgressState);
card = myRepository.fetchCardById(FEATURE_CARD_ID);
assertNotNull(card);
assertEquals(STATE_UPDATES_BOARD_ID, card.getIdBoard());
assertEquals(IN_PROGRESS_LIST_ID, card.getIdList());
// Discover "Backlog" list
task = new TrelloTask(card, myRepository);
states = myRepository.getAvailableTaskStates(task);
assertEquals(1, states.size());
final CustomTaskState backlogState = states.iterator().next();
assertEquals(BACKLOG_LIST_ID, backlogState.getId());
assertEquals("Backlog", backlogState.getPresentableName());
// In Progress -> Backlog
myRepository.setTaskState(task, backlogState);
card = myRepository.fetchCardById(FEATURE_CARD_ID);
assertNotNull(card);
assertEquals(STATE_UPDATES_BOARD_ID, card.getIdBoard());
assertEquals(BACKLOG_LIST_ID, card.getIdList());
}
Aggregations