Cleanup.
This commit is contained in:
parent
0e04a40a76
commit
167670c86e
1 changed files with 7 additions and 7 deletions
|
@ -36,6 +36,7 @@ import org.testng.annotations.Test;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.Temporal;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
@ -47,17 +48,17 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class TellMessageTest {
|
public class TellMessageTest {
|
||||||
private final String message = "Test message.";
|
private boolean isValidDate(final Temporal date) {
|
||||||
private final String recipient = "recipient";
|
|
||||||
private final String sender = "sender";
|
|
||||||
private final TellMessage tellMessage = new TellMessage(sender, recipient, message);
|
|
||||||
|
|
||||||
private boolean isValidDate(final LocalDateTime date) {
|
|
||||||
return Duration.between(date, LocalDateTime.now()).toMinutes() < 1;
|
return Duration.between(date, LocalDateTime.now()).toMinutes() < 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testTellMessage() {
|
void testTellMessage() {
|
||||||
|
final String message = "Test message.";
|
||||||
|
final String recipient = "recipient";
|
||||||
|
final String sender = "sender";
|
||||||
|
final TellMessage tellMessage = new TellMessage(sender, recipient, message);
|
||||||
|
|
||||||
assertThat(tellMessage.getSender()).as(sender).isEqualTo(sender);
|
assertThat(tellMessage.getSender()).as(sender).isEqualTo(sender);
|
||||||
assertThat(tellMessage.getRecipient()).as(recipient).isEqualTo(recipient);
|
assertThat(tellMessage.getRecipient()).as(recipient).isEqualTo(recipient);
|
||||||
assertThat(tellMessage.getMessage()).as(message).isEqualTo(message);
|
assertThat(tellMessage.getMessage()).as(message).isEqualTo(message);
|
||||||
|
@ -76,6 +77,5 @@ public class TellMessageTest {
|
||||||
tellMessage.setIsNotified();
|
tellMessage.setIsNotified();
|
||||||
assertThat(tellMessage.isNotified()).as("is notified").isTrue();
|
assertThat(tellMessage.isNotified()).as("is notified").isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue