Search in sources :

Example 1 with AvailableCommandsPacket

use of me.retrodaredevil.solarthing.commands.packets.status.AvailableCommandsPacket in project solarthing by wildmountainfarms.

the class CommandStatusPacketTest method test.

@Test
void test() throws JsonProcessingException {
    AvailableCommandsPacket packet = new ImmutableAvailableCommandsPacket(Collections.singletonList(new CommandInfo("asdf", "Asdf", "Cool")));
    assertEquals("asdf", packet.getCommandInfoList().get(0).getName());
    assertEquals(1, packet.getCommandInfoList().size());
    PacketTestUtil.testJson(packet, AvailableCommandsPacket.class);
    PacketTestUtil.testJson(packet, CommandStatusPacket.class);
}
Also used : ImmutableAvailableCommandsPacket(me.retrodaredevil.solarthing.commands.packets.status.ImmutableAvailableCommandsPacket) CommandInfo(me.retrodaredevil.solarthing.commands.CommandInfo) AvailableCommandsPacket(me.retrodaredevil.solarthing.commands.packets.status.AvailableCommandsPacket) ImmutableAvailableCommandsPacket(me.retrodaredevil.solarthing.commands.packets.status.ImmutableAvailableCommandsPacket) Test(org.junit.jupiter.api.Test)

Aggregations

CommandInfo (me.retrodaredevil.solarthing.commands.CommandInfo)1 AvailableCommandsPacket (me.retrodaredevil.solarthing.commands.packets.status.AvailableCommandsPacket)1 ImmutableAvailableCommandsPacket (me.retrodaredevil.solarthing.commands.packets.status.ImmutableAvailableCommandsPacket)1 Test (org.junit.jupiter.api.Test)1