PartnerTemplate implements PartnerOperations { public List<Application> getApplications() { return (List<Application>) restOperations.getForObject(URBANAIRSHIP_API_URL + "partner/apps", Applications.class); } PartnerTemplate(RestOperations restOperations); List<Application> getApplications(); URI createApplication(ApplicationData applicationData); void updateApplication(URI applicationUri, ApplicationData applicationData); void updateApplication(String applicationKey, ApplicationData applicationData);  }
@Test public void getApplications() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withResponse(jsonResource("data/application-list"), responseHeaders, HttpStatus.OK, "OK")); List<Application> apps = urbanAirship.partnerOperations().getApplications(); assertEquals(2, apps.size()); assertEquals("com.foo.bar", apps.get(0).getName()); assertEquals("XYZ123", apps.get(0).getKey()); assertEquals("F89X12", apps.get(0).getSecret()); assertEquals("AbC232", apps.get(0).getMasterSecret()); assertEquals(PushServiceStatus.DEVELOPMENT, apps.get(0).getPushServiceStatus()); assertEquals(PushStatus.NONE, apps.get(0).getPushStatus()); assertEquals(StoreKitMode.DISABLED, apps.get(0).getStoreKitMode()); assertEquals("https: assertEquals("com.foo.bar", apps.get(0).getAndroidPackageName()); assertEquals("c2dmToken", apps.get(0).getC2dmAuthToken()); assertEquals("bbUser", apps.get(0).getBlackberryUsername()); assertEquals("bbPassword", apps.get(0).getBlackberryPassword()); assertEquals("https: assertFalse(apps.get(0).isRichPushEnabled()); assertEquals("com.foo.baz", apps.get(1).getName()); assertEquals("ABC321", apps.get(1).getKey()); assertEquals("53CR3T", apps.get(1).getSecret()); assertEquals("B1G53CR3T", apps.get(1).getMasterSecret()); assertEquals(PushServiceStatus.PRODUCTION, apps.get(1).getPushServiceStatus()); assertEquals(PushStatus.READY, apps.get(1).getPushStatus()); assertEquals(StoreKitMode.DISABLED, apps.get(1).getStoreKitMode()); assertEquals("https: assertEquals("com.foo.baz", apps.get(1).getAndroidPackageName()); assertEquals("c2dmToken", apps.get(1).getC2dmAuthToken()); assertEquals("bbUser", apps.get(1).getBlackberryUsername()); assertEquals("bbPassword", apps.get(1).getBlackberryPassword()); assertEquals("https: assertFalse(apps.get(1).isRichPushEnabled()); mockServer.verify(); }