Search in sources :

Example 1 with RevisionUpdateToken

use of me.retrodaredevil.solarthing.database.couchdb.RevisionUpdateToken in project solarthing by wildmountainfarms.

the class CommandOpenPacketsTest method test.

@Test
void test() throws JsonProcessingException {
    PacketTestUtil.testJson(new ImmutableRequestCommandPacket("GEN OFF"), CommandOpenPacket.class, true);
    PacketTestUtil.testJson(new ImmutableRequestFlagPacket(new FlagData("disable_automations", new TimeRangeActivePeriod(TimeRange.create(Instant.parse("2021-10-05T04:53:22.877307Z"), Instant.parse("2021-10-05T04:53:44.305146Z"))))), CommandOpenPacket.class, true);
    PacketTestUtil.testJson(new ImmutableScheduleCommandPacket(new ScheduledCommandData(System.currentTimeMillis(), "GEN OFF", Collections.singleton(1)), UUID.randomUUID()), CommandOpenPacket.class, true);
    PacketTestUtil.testJson(new ImmutableDeleteAlterPacket("my_document_id", new RevisionUpdateToken("46-9ab7d71841380a36e1ec9e367deae36e")), CommandOpenPacket.class, true);
    PacketTestUtil.testJson(new ImmutableRequestHeartbeatPacket(new HeartbeatData("Hourly Mate Ping", "heartbeat.ping.mate.hourly", Duration.ofHours(1), Duration.ofMinutes(5)), UUID.randomUUID()), CommandOpenPacket.class, true);
}
Also used : FlagData(me.retrodaredevil.solarthing.type.alter.flag.FlagData) HeartbeatData(me.retrodaredevil.solarthing.type.event.feedback.HeartbeatData) RevisionUpdateToken(me.retrodaredevil.solarthing.database.couchdb.RevisionUpdateToken) TimeRangeActivePeriod(me.retrodaredevil.solarthing.type.alter.flag.TimeRangeActivePeriod) ScheduledCommandData(me.retrodaredevil.solarthing.type.alter.packets.ScheduledCommandData) Test(org.junit.jupiter.api.Test)

Aggregations

RevisionUpdateToken (me.retrodaredevil.solarthing.database.couchdb.RevisionUpdateToken)1 FlagData (me.retrodaredevil.solarthing.type.alter.flag.FlagData)1 TimeRangeActivePeriod (me.retrodaredevil.solarthing.type.alter.flag.TimeRangeActivePeriod)1 ScheduledCommandData (me.retrodaredevil.solarthing.type.alter.packets.ScheduledCommandData)1 HeartbeatData (me.retrodaredevil.solarthing.type.event.feedback.HeartbeatData)1 Test (org.junit.jupiter.api.Test)1