use of org.sonar.core.user.DefaultUser in project sonarqube by SonarSource.
the class IssueFieldsSetterTest method assign.
@Test
public void assign() {
User user = new DefaultUser().setLogin("emmerik").setName("Emmerik");
boolean updated = updater.assign(issue, user, context);
assertThat(updated).isTrue();
assertThat(issue.assignee()).isEqualTo("emmerik");
assertThat(issue.mustSendNotifications()).isTrue();
FieldDiffs.Diff diff = issue.currentChange().get(ASSIGNEE);
assertThat(diff.oldValue()).isEqualTo(UNUSED);
assertThat(diff.newValue()).isEqualTo("Emmerik");
}
use of org.sonar.core.user.DefaultUser in project sonarqube by SonarSource.
the class DefaultUserTest method test_object_methods.
@Test
public void test_object_methods() throws Exception {
DefaultUser john = new DefaultUser().setLogin("john").setName("John");
DefaultUser eric = new DefaultUser().setLogin("eric").setName("Eric");
assertThat(john).isEqualTo(john);
assertThat(john).isNotEqualTo(eric);
assertThat(john.hashCode()).isEqualTo(john.hashCode());
assertThat(john.toString()).contains("login=john").contains("name=John");
}
Aggregations