use of org.sonar.ce.task.log.CeTaskMessages.Message in project sonarqube by SonarSource.
the class CeTaskMessagesMessageTest method hashsode_is_based_on_text_and_timestamp.
@Test
public void hashsode_is_based_on_text_and_timestamp() {
long timestamp = 10_000_000_000L;
String text = randomAlphabetic(23);
Message underTest = new Message(text, timestamp);
assertThat(underTest.hashCode()).isEqualTo(underTest.hashCode()).isEqualTo(new Message(text, timestamp).hashCode()).isNotEqualTo(new Message(text + "ç", timestamp).hashCode()).isNotEqualTo(new Message(text, timestamp + 10_999L).hashCode()).isNotEqualTo(new Object().hashCode());
}
use of org.sonar.ce.task.log.CeTaskMessages.Message in project sonarqube by SonarSource.
the class CeTaskMessagesMessageTest method equals_is_based_on_text_and_timestamp.
@Test
public void equals_is_based_on_text_and_timestamp() {
long timestamp = 10_000_000_000L;
String text = randomAlphabetic(23);
Message underTest = new Message(text, timestamp);
assertThat(underTest).isEqualTo(underTest).isEqualTo(new Message(text, timestamp)).isNotEqualTo(new Message(text + "ç", timestamp)).isNotEqualTo(new Message(text, timestamp + 10_999L)).isNotNull().isNotEqualTo(new Object());
}