Search in sources :

Example 1 with StartingData

use of com.iluwatar.databus.data.StartingData in project java-design-patterns by iluwatar.

the class StatusMemberTest method statusRecordsTheStartTime.

@Test
public void statusRecordsTheStartTime() {
    // given
    final LocalDateTime startTime = LocalDateTime.of(2017, Month.APRIL, 1, 19, 9);
    final StartingData startingData = new StartingData(startTime);
    final StatusMember statusMember = new StatusMember(1);
    // when
    statusMember.accept(startingData);
    // then
    assertEquals(startTime, statusMember.getStarted());
}
Also used : LocalDateTime(java.time.LocalDateTime) StartingData(com.iluwatar.databus.data.StartingData) Test(org.junit.jupiter.api.Test)

Example 2 with StartingData

use of com.iluwatar.databus.data.StartingData in project java-design-patterns by iluwatar.

the class MessageCollectorMemberTest method collectIgnoresMessageFromOtherDataTypes.

@Test
public void collectIgnoresMessageFromOtherDataTypes() {
    // given
    final StartingData startingData = new StartingData(LocalDateTime.now());
    final MessageCollectorMember collector = new MessageCollectorMember("collector");
    // when
    collector.accept(startingData);
    // then
    assertEquals(0, collector.getMessages().size());
}
Also used : StartingData(com.iluwatar.databus.data.StartingData) Test(org.junit.jupiter.api.Test)

Aggregations

StartingData (com.iluwatar.databus.data.StartingData)2 Test (org.junit.jupiter.api.Test)2 LocalDateTime (java.time.LocalDateTime)1