Full Fix to getRegisteredApps

Change-Id: I63efb375af941cebcbd858b9b8f03524a72f0562
diff --git a/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java b/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java
index 5528f26..203abb7 100644
--- a/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java
@@ -29,6 +29,8 @@
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.DefaultApplication;
 import org.onosproject.core.DefaultApplicationId;
+import org.onosproject.core.Version;
+import org.onosproject.core.VersionServiceAdapter;
 
 import java.io.InputStream;
 import java.net.URI;
@@ -49,10 +51,13 @@
 public class ApplicationManagerTest {
 
     public static final DefaultApplicationId APP_ID = new DefaultApplicationId(1, APP_NAME);
+    private static final Version CORE_VERSION = Version.version(2, 1, "0", "");
 
     private ApplicationManager mgr = new ApplicationManager();
     private ApplicationListener listener = new TestListener();
 
+
+
     private boolean deactivated = false;
 
     @Before
@@ -81,6 +86,22 @@
     }
 
     @Test
+    public void testGetRegisteredApps() {
+        mgr.versionService = new TestVersionService();
+        Set<Application> apps = mgr.getRegisteredApplications();
+        System.out.println(apps);
+        assertFalse("SET contains less Apps than it should", apps.size() < 158);
+    }
+
+    private static class TestVersionService extends VersionServiceAdapter {
+
+        @Override
+        public Version version() {
+            return CORE_VERSION;
+        }
+    }
+
+    @Test
     public void install() {
         InputStream stream = ApplicationArchive.class.getResourceAsStream("app.zip");
         Application app = mgr.install(stream);
@@ -223,4 +244,4 @@
         }
     }
 
-}
+}
\ No newline at end of file