@Test public void getSliEntityShouldUseCorrectType() throws Exception { setupCustomDataMocking(); Entity expected = new GenericEntity(SLI_TYPE2, new HashMap<String, Object>()); List<Entity> queryResult = Arrays.asList(new Entity[] { expected }); when(mockSlcInterface.read(eq(SLI_TYPE2), any(Query.class))).thenReturn(queryResult); Entity result = resolver.getSliEntity(SIF_REF_ID2, ZONE_ID1); Mockito.verify(mockSlcInterface).read(eq(SLI_TYPE2), any(Query.class)); assertEquals(expected, result); }
@Override public Entity getSliEntity(String sifId, String zoneId) { synchronized (lock) { List<Entity> entities = getSliEntityList(sifId, zoneId); if (entities == null || entities.size() == 0) { LOG.warn("No entity found for sifId: " + sifId); return null; } return entities.get(0); } }
SifIdResolverCustomData implements SifIdResolver { @Override public Entity getSliEntity(String sifId, String zoneId) { synchronized (lock) { List<Entity> entities = getSliEntityList(sifId, zoneId); if (entities == null || entities.size() == 0) { LOG.warn("No entity found for sifId: " + sifId); return null; } return entities.get(0); } } }
SifIdResolverCustomData implements SifIdResolver { @Override public Entity getSliEntity(String sifId, String zoneId) { synchronized (lock) { List<Entity> entities = getSliEntityList(sifId, zoneId); if (entities == null || entities.size() == 0) { LOG.warn("No entity found for sifId: " + sifId); return null; } return entities.get(0); } }  }
SifIdResolverCustomData implements SifIdResolver { @Override public Entity getSliEntity(String sifId, String zoneId) { synchronized (lock) { List<Entity> entities = getSliEntityList(sifId, zoneId); if (entities == null || entities.size() == 0) { LOG.warn("No entity found for sifId: " + sifId); return null; } return entities.get(0); } }  @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 Entity getSliEntity(String sifId, String zoneId) { synchronized (lock) { List<Entity> entities = getSliEntityList(sifId, zoneId); if (entities == null || entities.size() == 0) { LOG.warn("No entity found for sifId: " + sifId); return null; } return entities.get(0); } }  @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);  }