@Test public void testGetProjectList_nonExisting() { RestInvocations.loadProjectLists(handler, "defect"); Field field = new Field("non-existing", "Non-existing"); field.setListId(10000); List<String> list = projectListService.getProjectList("defect", field); Assert.assertTrue(list.isEmpty()); }
public List<String> getProjectList(String entityType, Field field) { String relatedType = field.getRelatedType(); List<String> values; if(relatedType != null) { values = getValue(relatedType).get(field.getListId()); } else { values = getValue(entityType).get(field.getListId()); } if(values == null) { return Collections.emptyList(); } else { return values; } }
ProjectListService extends AbstractCachingService<String, Map<Integer, List<String>>, AbstractCachingService.Callback<Map<Integer, List<String>>>> { public List<String> getProjectList(String entityType, Field field) { String relatedType = field.getRelatedType(); List<String> values; if(relatedType != null) { values = getValue(relatedType).get(field.getListId()); } else { values = getValue(entityType).get(field.getListId()); } if(values == null) { return Collections.emptyList(); } else { return values; } } }
ProjectListService extends AbstractCachingService<String, Map<Integer, List<String>>, AbstractCachingService.Callback<Map<Integer, List<String>>>> { public List<String> getProjectList(String entityType, Field field) { String relatedType = field.getRelatedType(); List<String> values; if(relatedType != null) { values = getValue(relatedType).get(field.getListId()); } else { values = getValue(entityType).get(field.getListId()); } if(values == null) { return Collections.emptyList(); } else { return values; } } ProjectListService(Project project, RestService restService); }
ProjectListService extends AbstractCachingService<String, Map<Integer, List<String>>, AbstractCachingService.Callback<Map<Integer, List<String>>>> { public List<String> getProjectList(String entityType, Field field) { String relatedType = field.getRelatedType(); List<String> values; if(relatedType != null) { values = getValue(relatedType).get(field.getListId()); } else { values = getValue(entityType).get(field.getListId()); } if(values == null) { return Collections.emptyList(); } else { return values; } } ProjectListService(Project project, RestService restService); List<String> getProjectList(String entityType, Field field); }
ProjectListService extends AbstractCachingService<String, Map<Integer, List<String>>, AbstractCachingService.Callback<Map<Integer, List<String>>>> { public List<String> getProjectList(String entityType, Field field) { String relatedType = field.getRelatedType(); List<String> values; if(relatedType != null) { values = getValue(relatedType).get(field.getListId()); } else { values = getValue(entityType).get(field.getListId()); } if(values == null) { return Collections.emptyList(); } else { return values; } } ProjectListService(Project project, RestService restService); List<String> getProjectList(String entityType, Field field);  }