Package org.sonar.api.issue.action

Examples of org.sonar.api.issue.action.Function


    actionService = new ActionService(dbClient, issueService, issueStorage, updater, settings, propertiesDao, actions);
  }

  @Test
  public void execute_functions() {
    Function function1 = mock(Function.class);
    Function function2 = mock(Function.class);

    when(componentDao.getByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class));
    when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue);

    actions.add("link-to-jira").setConditions(new AlwaysMatch()).setFunctions(function1, function2);
View Full Code Here


    verifyNoMoreInteractions(function1, function2);
  }

  @Test
  public void modify_issue_when_executing_a_function() {
    Function function = new TweetFunction();

    UserSession userSession = mock(UserSession.class);
    when(userSession.login()).thenReturn("arthur");

    when(componentDao.getByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class));
View Full Code Here

    verify(updater).setAttribute(any(DefaultIssue.class), eq("tweet"), eq("tweet sent"), any(IssueChangeContext.class));
  }

  @Test
  public void inject_project_settings_when_executing_a_function() {
    Function function = new TweetFunction();

    UserSession userSession = mock(UserSession.class);
    when(userSession.login()).thenReturn("arthur");

    when(componentDao.getByKey(session, "struts")).thenReturn(new ComponentDto().setKey("struts"));
View Full Code Here

    verify(propertiesDao).selectProjectProperties(eq("struts"));
  }

  @Test
  public void not_execute_function_if_action_not_found() {
    Function function = mock(Function.class);

    when(componentDao.getByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class));
    when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue);

    actions.add("link-to-jira").setConditions(new AlwaysMatch()).setFunctions(function);
View Full Code Here

    verifyZeroInteractions(function);
  }

  @Test
  public void not_execute_function_if_action_is_not_supported() {
    Function function = mock(Function.class);

    when(componentDao.getByKey(eq(session), anyString())).thenReturn(mock(ComponentDto.class));
    when(issueService.getByKeyForUpdate(session, "ABCD")).thenReturn(issue);

    actions.add("link-to-jira").setConditions(new NeverMatch()).setFunctions(function);
View Full Code Here

TOP

Related Classes of org.sonar.api.issue.action.Function

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.