@Test public void testGetAppGroupId() throws AppRepositoryClientException, MalformedURLException, RemoteApiException { testAppsAvailable(); AppStoreWrapper wrapper = mockAppStoreWrapper(); Map<String, Object> expected = mockAppStoreResult(wrapper); Map<String, Object> result = repository.getAppByAppGroupId(MOCK_APP_ID, DEFAULT_USER_ID); assertEquals(expected, result); }
public Map<String, Object> getAppByAppGroupId(String appGroupId, String userId) throws AppRepositoryClientException { List appsAvailable = getAppsAvailable(userId); for (Object app : appsAvailable) { Map<String, Object> appData = (Map<String, Object>) app; String currentAppGroupId = (String) appData.get(APPS_REP_APP_GROUP_ID_PATH); if (currentAppGroupId.equals(appGroupId)) { return appData; } } return null; }
AppRepositoryClient { public Map<String, Object> getAppByAppGroupId(String appGroupId, String userId) throws AppRepositoryClientException { List appsAvailable = getAppsAvailable(userId); for (Object app : appsAvailable) { Map<String, Object> appData = (Map<String, Object>) app; String currentAppGroupId = (String) appData.get(APPS_REP_APP_GROUP_ID_PATH); if (currentAppGroupId.equals(appGroupId)) { return appData; } } return null; } }
AppRepositoryClient { public Map<String, Object> getAppByAppGroupId(String appGroupId, String userId) throws AppRepositoryClientException { List appsAvailable = getAppsAvailable(userId); for (Object app : appsAvailable) { Map<String, Object> appData = (Map<String, Object>) app; String currentAppGroupId = (String) appData.get(APPS_REP_APP_GROUP_ID_PATH); if (currentAppGroupId.equals(appGroupId)) { return appData; } } return null; }  }
AppRepositoryClient { public Map<String, Object> getAppByAppGroupId(String appGroupId, String userId) throws AppRepositoryClientException { List appsAvailable = getAppsAvailable(userId); for (Object app : appsAvailable) { Map<String, Object> appData = (Map<String, Object>) app; String currentAppGroupId = (String) appData.get(APPS_REP_APP_GROUP_ID_PATH); if (currentAppGroupId.equals(appGroupId)) { return appData; } } return null; }  List getAppsAvailable(String userId); Map<String, Object> getAppByAppGroupId(String appGroupId, String userId); void createNewApp(AppStoreWrapper appStoreApp, String userId); void updateApp(AppStoreWrapper appStoreApp, String userId); }
AppRepositoryClient { public Map<String, Object> getAppByAppGroupId(String appGroupId, String userId) throws AppRepositoryClientException { List appsAvailable = getAppsAvailable(userId); for (Object app : appsAvailable) { Map<String, Object> appData = (Map<String, Object>) app; String currentAppGroupId = (String) appData.get(APPS_REP_APP_GROUP_ID_PATH); if (currentAppGroupId.equals(appGroupId)) { return appData; } } return null; }  List getAppsAvailable(String userId); Map<String, Object> getAppByAppGroupId(String appGroupId, String userId); void createNewApp(AppStoreWrapper appStoreApp, String userId); void updateApp(AppStoreWrapper appStoreApp, String userId);  }