@Test public void putSliGuidStoreAdditionalId() throws Exception { Map<String, List<SliEntityLocator>> idMap = setupCustomDataMocking(); when(mockSeaCustomDataProvider.getIdMap(SEA_ID1)).thenReturn(idMap); resolver.putSliGuid(SIF_REF_ID1, SLI_TYPE1, "someNewId", ZONE_ID1); List<SliEntityLocator> resultList = idMap.get(SIF_REF_ID1); Assert.assertNotNull(resultList); Assert.assertEquals(2, resultList.size()); SliEntityLocator locator = resultList.get(1); Assert.assertEquals(SLI_TYPE1, locator.getType()); Assert.assertEquals("someNewId", locator.getValue()); Assert.assertEquals(ParameterConstants.ID, locator.getField()); }
@Override public void putSliGuid(String sifId, String sliType, String sliId, String zoneId) { synchronized (lock) { String seaGuid = getZoneSea(zoneId); Map<String, List<SliEntityLocator>> idMap = customDataProvider.getIdMap(seaGuid); SliEntityLocator id = new SliEntityLocator(sliType, sliId, ParameterConstants.ID); List<SliEntityLocator> existingIdList = idMap.get(sifId); if (existingIdList == null) { existingIdList = new ArrayList<SliEntityLocator>(); } else { for (SliEntityLocator locator : existingIdList) { if (locator.getField().equals(ParameterConstants.ID) && locator.getType().equals(sliType) && locator.getValue().equals(sliId)) { return; } } } existingIdList.add(id); idMap.put(sifId, existingIdList); customDataProvider.storeIdMap(seaGuid, idMap); } }
SifIdResolverCustomData implements SifIdResolver { @Override public void putSliGuid(String sifId, String sliType, String sliId, String zoneId) { synchronized (lock) { String seaGuid = getZoneSea(zoneId); Map<String, List<SliEntityLocator>> idMap = customDataProvider.getIdMap(seaGuid); SliEntityLocator id = new SliEntityLocator(sliType, sliId, ParameterConstants.ID); List<SliEntityLocator> existingIdList = idMap.get(sifId); if (existingIdList == null) { existingIdList = new ArrayList<SliEntityLocator>(); } else { for (SliEntityLocator locator : existingIdList) { if (locator.getField().equals(ParameterConstants.ID) && locator.getType().equals(sliType) && locator.getValue().equals(sliId)) { return; } } } existingIdList.add(id); idMap.put(sifId, existingIdList); customDataProvider.storeIdMap(seaGuid, idMap); } } }
SifIdResolverCustomData implements SifIdResolver { @Override public void putSliGuid(String sifId, String sliType, String sliId, String zoneId) { synchronized (lock) { String seaGuid = getZoneSea(zoneId); Map<String, List<SliEntityLocator>> idMap = customDataProvider.getIdMap(seaGuid); SliEntityLocator id = new SliEntityLocator(sliType, sliId, ParameterConstants.ID); List<SliEntityLocator> existingIdList = idMap.get(sifId); if (existingIdList == null) { existingIdList = new ArrayList<SliEntityLocator>(); } else { for (SliEntityLocator locator : existingIdList) { if (locator.getField().equals(ParameterConstants.ID) && locator.getType().equals(sliType) && locator.getValue().equals(sliId)) { return; } } } existingIdList.add(id); idMap.put(sifId, existingIdList); customDataProvider.storeIdMap(seaGuid, idMap); } }  }
SifIdResolverCustomData implements SifIdResolver { @Override public void putSliGuid(String sifId, String sliType, String sliId, String zoneId) { synchronized (lock) { String seaGuid = getZoneSea(zoneId); Map<String, List<SliEntityLocator>> idMap = customDataProvider.getIdMap(seaGuid); SliEntityLocator id = new SliEntityLocator(sliType, sliId, ParameterConstants.ID); List<SliEntityLocator> existingIdList = idMap.get(sifId); if (existingIdList == null) { existingIdList = new ArrayList<SliEntityLocator>(); } else { for (SliEntityLocator locator : existingIdList) { if (locator.getField().equals(ParameterConstants.ID) && locator.getType().equals(sliType) && locator.getValue().equals(sliId)) { return; } } } existingIdList.add(id); idMap.put(sifId, existingIdList); customDataProvider.storeIdMap(seaGuid, idMap); } }  @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 void putSliGuid(String sifId, String sliType, String sliId, String zoneId) { synchronized (lock) { String seaGuid = getZoneSea(zoneId); Map<String, List<SliEntityLocator>> idMap = customDataProvider.getIdMap(seaGuid); SliEntityLocator id = new SliEntityLocator(sliType, sliId, ParameterConstants.ID); List<SliEntityLocator> existingIdList = idMap.get(sifId); if (existingIdList == null) { existingIdList = new ArrayList<SliEntityLocator>(); } else { for (SliEntityLocator locator : existingIdList) { if (locator.getField().equals(ParameterConstants.ID) && locator.getType().equals(sliType) && locator.getValue().equals(sliId)) { return; } } } existingIdList.add(id); idMap.put(sifId, existingIdList); customDataProvider.storeIdMap(seaGuid, idMap); } }  @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);  }