@Test public void getSliGuidListByTypeShouldLookupSliGuids() throws Exception { setupCustomDataMocking(); List<Entity> expected = new ArrayList<Entity>(); Entity entity = Mockito.mock(Entity.class); when(entity.getId()).thenReturn(SLI_ID3A); List<Entity> queryResult = Arrays.asList(new Entity[] { entity }); when(mockSlcInterface.read(eq(SLI_TYPE3A), any(Query.class))).thenReturn(queryResult); expected.add(entity); entity = Mockito.mock(Entity.class); when(entity.getId()).thenReturn(SLI_ID3B); queryResult = Arrays.asList(new Entity[] { entity }); when(mockSlcInterface.read(eq(SLI_TYPE3B), any(Query.class))).thenReturn(queryResult); expected.add(entity); List<String> result = resolver.getSliGuidListByType(SIF_REF_ID3, SLI_TYPE3A, ZONE_ID1); Assert.assertEquals(expected.size(), result.size()); Assert.assertEquals(SLI_ID3A, result.get(0)); Assert.assertEquals(SLI_ID3B, result.get(1)); }
@Override public List<String> getSliGuidListByType(String sifId, String sliType, String zoneId) { synchronized (lock) { List<Entity> entityList = getSliEntityListByType(sifId, sliType, zoneId); List<String> idList = new ArrayList<String>(); for (Entity entity : entityList) { idList.add(entity.getId()); } return idList; } }
SifIdResolverCustomData implements SifIdResolver { @Override public List<String> getSliGuidListByType(String sifId, String sliType, String zoneId) { synchronized (lock) { List<Entity> entityList = getSliEntityListByType(sifId, sliType, zoneId); List<String> idList = new ArrayList<String>(); for (Entity entity : entityList) { idList.add(entity.getId()); } return idList; } } }
SifIdResolverCustomData implements SifIdResolver { @Override public List<String> getSliGuidListByType(String sifId, String sliType, String zoneId) { synchronized (lock) { List<Entity> entityList = getSliEntityListByType(sifId, sliType, zoneId); List<String> idList = new ArrayList<String>(); for (Entity entity : entityList) { idList.add(entity.getId()); } return idList; } }  }
SifIdResolverCustomData implements SifIdResolver { @Override public List<String> getSliGuidListByType(String sifId, String sliType, String zoneId) { synchronized (lock) { List<Entity> entityList = getSliEntityListByType(sifId, sliType, zoneId); List<String> idList = new ArrayList<String>(); for (Entity entity : entityList) { idList.add(entity.getId()); } return idList; } }  @Override String getSliGuid(String sifId, String zoneId); @Override List<String> getSliGuidList(String sifId, String zoneId); @Override String getSliGuidByType(String sifId, String sliType, String zoneId); @Override List<String> getSliGuidListByType(String sifId, String sliType, String zoneId); @Override Entity getSliEntityByType(String sifId, String sliType, String zoneId); @Override List<Entity> getSliEntityListByType(String sifId, String sliType, String zoneId); @Override Entity getSliEntity(String sifId, String zoneId); @Override List<Entity> getSliEntityList(String sifId, String zoneId); @Override String getZoneSea(String zoneId); @Override void putSliGuid(String sifId, String sliType, String sliId, String zoneId); @Override Entity getSliEntityFromOtherSifId(String sifId, String sliType, String zoneId); @Override void putSliGuidForOtherSifId(String sifId, String sliType, String sliId, String zoneId); }
SifIdResolverCustomData implements SifIdResolver { @Override public List<String> getSliGuidListByType(String sifId, String sliType, String zoneId) { synchronized (lock) { List<Entity> entityList = getSliEntityListByType(sifId, sliType, zoneId); List<String> idList = new ArrayList<String>(); for (Entity entity : entityList) { idList.add(entity.getId()); } return idList; } }  @Override String getSliGuid(String sifId, String zoneId); @Override List<String> getSliGuidList(String sifId, String zoneId); @Override String getSliGuidByType(String sifId, String sliType, String zoneId); @Override List<String> getSliGuidListByType(String sifId, String sliType, String zoneId); @Override Entity getSliEntityByType(String sifId, String sliType, String zoneId); @Override List<Entity> getSliEntityListByType(String sifId, String sliType, String zoneId); @Override Entity getSliEntity(String sifId, String zoneId); @Override List<Entity> getSliEntityList(String sifId, String zoneId); @Override String getZoneSea(String zoneId); @Override void putSliGuid(String sifId, String sliType, String sliId, String zoneId); @Override Entity getSliEntityFromOtherSifId(String sifId, String sliType, String zoneId); @Override void putSliGuidForOtherSifId(String sifId, String sliType, String sliId, String zoneId);  }