@Test public void getZoneSeaShouldLookupSeaGuid() throws Exception { when(mockZoneMapProvider.getZoneToSliIdMap()).thenReturn(getDummySeaIdMap()); Entity seaEntity = Mockito.mock(Entity.class); when(seaEntity.getId()).thenReturn(SEA_ID2); List<Entity> queryResult = Arrays.asList(new Entity[] { seaEntity }); when(mockSlcInterface.read(eq(SLI_TYPE_SEA2), queryCaptor.capture())).thenReturn(queryResult); String seaId = resolver.getZoneSea(ZONE_ID2); Assert.assertEquals(1, queryCaptor.getAllValues().size()); Assert.assertEquals(SLI_VALUE_SEA2, queryCaptor.getAllValues().get(0).getParameters().get(SLI_FIELD_SEA2)); Assert.assertEquals(SEA_ID2, seaId); }
@Override public String getZoneSea(String zoneId) { synchronized (lock) { Map<String, SliEntityLocator> seaMap = zoneMapProvider.getZoneToSliIdMap(); SliEntityLocator locator = seaMap.get(zoneId); Entity seaEntity = fetchSliEntity(locator); if (seaEntity == null) { return null; } return seaEntity.getId(); } }
SifIdResolverCustomData implements SifIdResolver { @Override public String getZoneSea(String zoneId) { synchronized (lock) { Map<String, SliEntityLocator> seaMap = zoneMapProvider.getZoneToSliIdMap(); SliEntityLocator locator = seaMap.get(zoneId); Entity seaEntity = fetchSliEntity(locator); if (seaEntity == null) { return null; } return seaEntity.getId(); } } }
SifIdResolverCustomData implements SifIdResolver { @Override public String getZoneSea(String zoneId) { synchronized (lock) { Map<String, SliEntityLocator> seaMap = zoneMapProvider.getZoneToSliIdMap(); SliEntityLocator locator = seaMap.get(zoneId); Entity seaEntity = fetchSliEntity(locator); if (seaEntity == null) { return null; } return seaEntity.getId(); } }  }
SifIdResolverCustomData implements SifIdResolver { @Override public String getZoneSea(String zoneId) { synchronized (lock) { Map<String, SliEntityLocator> seaMap = zoneMapProvider.getZoneToSliIdMap(); SliEntityLocator locator = seaMap.get(zoneId); Entity seaEntity = fetchSliEntity(locator); if (seaEntity == null) { return null; } return seaEntity.getId(); } }  @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 String getZoneSea(String zoneId) { synchronized (lock) { Map<String, SliEntityLocator> seaMap = zoneMapProvider.getZoneToSliIdMap(); SliEntityLocator locator = seaMap.get(zoneId); Entity seaEntity = fetchSliEntity(locator); if (seaEntity == null) { return null; } return seaEntity.getId(); } }  @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);  }