Package org.sonar.core.user

Examples of org.sonar.core.user.DefaultUser


  public void should_verify_assignee_exists() {
    String assignee = "arthur";
    Map<String, Object> properties = newHashMap();
    properties.put("assignee", assignee);

    User user = new DefaultUser().setLogin(assignee);

    List<Issue> issues = newArrayList((Issue) new DefaultIssue().setKey("ABC"));
    when(userFinder.findByLogin(assignee)).thenReturn(user);
    assertThat(action.verify(properties, issues, mock(UserSession.class))).isTrue();
    assertThat(properties.get(AssignAction.VERIFIED_ASSIGNEE)).isEqualTo(user);
View Full Code Here


  @Test
  public void load_changelog_and_related_users() throws Exception {
    FieldDiffs userChange = new FieldDiffs().setUserLogin("arthur").setDiff("severity", "MAJOR", "BLOCKER");
    FieldDiffs scanChange = new FieldDiffs().setDiff("status", "RESOLVED", "CLOSED");
    when(changeDao.selectChangelogByIssue("ABCDE")).thenReturn(Arrays.asList(userChange, scanChange));
    User arthur = new DefaultUser().setLogin("arthur").setName("Arthur");
    when(userFinder.findByLogins(Arrays.asList("arthur"))).thenReturn(Arrays.asList(arthur));

    when(issueService.getByKey("ABCDE")).thenReturn(new DefaultIssue().setKey("ABCDE"));

    IssueChangelog changelog = service.changelog("ABCDE");
View Full Code Here

TOP

Related Classes of org.sonar.core.user.DefaultUser

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.