Search in sources :

Example 1 with TrelloTask

use of com.intellij.tasks.trello.TrelloTask 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());
}
Also used : TrelloTask(com.intellij.tasks.trello.TrelloTask) CustomTaskState(com.intellij.tasks.CustomTaskState)

Aggregations

CustomTaskState (com.intellij.tasks.CustomTaskState)1 TrelloTask (com.intellij.tasks.trello.TrelloTask)1