summaryrefslogtreecommitdiff
path: root/same/src/test/java
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-27 13:47:26 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-27 13:47:26 +0100
commit3d0ddd70342bee8826997e9a2343a5741e243a0d (patch)
treea464317e76395d2177010ebbdd2487c0b52e07c6 /same/src/test/java
parent52c1e7a6643d4a010c5571f565386440e17fe5e6 (diff)
ClientService supports network discovery.
Diffstat (limited to 'same/src/test/java')
-rw-r--r--same/src/test/java/com/orbekk/same/ClientServiceImplTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java b/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java
index 2baa829..39c0e7c 100644
--- a/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java
+++ b/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java
@@ -3,6 +3,7 @@ package com.orbekk.same;
import static org.junit.Assert.*;
import org.junit.Test;
+import static org.mockito.Mockito.*;
public class ClientServiceImplTest {
private State state = new State("ClientNetwork");
@@ -15,4 +16,12 @@ public class ClientServiceImplTest {
assertEquals(100, state.getRevision("TestState"));
assertEquals("Test data", state.getDataOf("TestState"));
}
+
+ @Test public void testNetworkListener() {
+ NetworkNotificationListener listener =
+ mock(NetworkNotificationListener.class);
+ client.setNetworkListener(listener);
+ client.notifyNetwork("MyNetwork", "MasterUrl");
+ verify(listener).notifyNetwork("MyNetwork", "MasterUrl");
+ }
}