diff --git a/src/test/java/com/intel/jndn/utils/ClientTest.java b/src/test/java/com/intel/jndn/utils/ClientTest.java
index a294817..88c39cc 100644
--- a/src/test/java/com/intel/jndn/utils/ClientTest.java
+++ b/src/test/java/com/intel/jndn/utils/ClientTest.java
@@ -70,7 +70,7 @@
     // retrieve data
     logger.info("Client expressing interest asynchronously: /test/async");
     Client client = new Client();
-    ClientObserver observer = client.get(face, new Name("/test/async"));
+    NDNObserver observer = client.get(face, new Name("/test/async"));
 
     // wait 
     while (observer.eventCount() == 0) {
@@ -95,7 +95,7 @@
 
     // retrieve non-existent data, should timeout
     logger.info("Client expressing interest asynchronously: /test/timeout");
-    ClientObserver observer = Client.getDefault().get(face, new Name("/test/timeout"));
+    NDNObserver observer = Client.getDefault().get(face, new Name("/test/timeout"));
 
     // wait 
     while (observer.errorCount() == 0) {
@@ -122,10 +122,10 @@
 
     // retrieve non-existent data, should timeout
     logger.info("Client expressing interest asynchronously: /test/callback");
-    ClientObserver observer = Client.getDefault().get(face, new Name("/test/callback"));
+    NDNObserver observer = Client.getDefault().get(face, new Name("/test/callback"));
     observer.then(new OnEvent(){
       @Override
-      public void onEvent(ClientEvent event) {
+      public void onEvent(NDNEvent event) {
         assertEquals(new Blob("...").buf(), ((Data) event.getPacket()).getContent().buf());
       }
     });
diff --git a/src/test/java/com/intel/jndn/utils/ServerTest.java b/src/test/java/com/intel/jndn/utils/ServerTest.java
new file mode 100644
index 0000000..a2b1880
--- /dev/null
+++ b/src/test/java/com/intel/jndn/utils/ServerTest.java
@@ -0,0 +1,58 @@
+/*
+ * File name: ServerTest.java
+ * 
+ * Purpose: Test Server.java 
+ * 
+ * © Copyright Intel Corporation. All rights reserved.
+ * Intel Corporation, 2200 Mission College Boulevard,
+ * Santa Clara, CA 95052-8119, USA
+ */
+package com.intel.jndn.utils;
+
+import com.intel.jndn.mock.MockTransport;
+import net.named_data.jndn.Data;
+import net.named_data.jndn.Face;
+import net.named_data.jndn.Interest;
+import net.named_data.jndn.Name;
+import net.named_data.jndn.util.Blob;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ * Test Server.java
+ * @author Andrew Brown <andrew.brown@intel.com>
+ */
+public class ServerTest {
+
+  private static final Logger logger = LogManager.getLogger();
+
+  /**
+   * Test on functionality
+   * TODO more comprehensive tests with InternalFace
+   * @throws java.lang.InterruptedException
+   */
+  @Test
+  public void testOn() throws InterruptedException {
+    // setup face
+    MockTransport transport = new MockTransport();
+    Face face = new Face(transport, null);
+
+    // setup server
+    NDNObserver observer = Server.getDefault().on(face, new Name("/test/server/on"), new OnServeInterest() {
+      @Override
+      public Data onInterest(Name prefix, Interest interest) {
+        Data data = new Data(interest.getName());
+        data.setContent(new Blob("..."));
+        return data;
+      }
+    });
+    
+    // wait for background threads to run
+    Thread.sleep(100);
+
+    // check
+    assertEquals(1, transport.getSentInterestPackets().size());
+  }
+}
