diff options
Diffstat (limited to 'same/src/test/java')
-rw-r--r-- | same/src/test/java/com/orbekk/same/ClientTest.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/same/src/test/java/com/orbekk/same/ClientTest.java b/same/src/test/java/com/orbekk/same/ClientTest.java index a4671d4..91f9760 100644 --- a/same/src/test/java/com/orbekk/same/ClientTest.java +++ b/same/src/test/java/com/orbekk/same/ClientTest.java @@ -34,4 +34,13 @@ public class ClientTest { client.discover("mockClient/ClientService.json"); verify(mockClient).notifyNetwork("ClientNetwork", "master"); } + + @Test public void stateListenerReceivesUpdate() throws Exception { + StateChangedListener listener = mock(StateChangedListener.class); + client.getInterface().addStateListener(listener); + clientS.setState("StateListenerVariable", "100", 1); + State.Component component = state.getComponent("StateListenerVariable"); + assertEquals("100", component.getData()); + verify(listener).stateChanged(eq(component)); + } } |