@Test public void testGetCaptureImageIds() { String deviceIds[] = {"000000000001", "000000000002"}; String capturedImageIds[] = {"Image001", "Image002"}; MockHttpSession session = new MockHttpSession(); VideoSnap videoSnap = EasyMock.createMockBuilder(VideoSnap.class) .addMockedMethod("captureImage", String.class, HttpSession.class, MetaStbCache.class).createMock(); MetaStbCache metaStbCache = new MetaStbCache(); for (int i = 0; i < deviceIds.length; i++) { EasyMock.expect(videoSnap.captureImage(deviceIds[i], session, metaStbCache)).andReturn(capturedImageIds[i]); } EasyMock.replay(videoSnap); videoSnap.getCaptureImageIds(deviceIds, session, metaStbCache); EasyMock.verify(videoSnap); }
public Map<String, String> getCaptureImageIds(String[] deviceIds, HttpSession session, MetaStbCache metaStbCache) { Map<String, String> deviceIdImageIdMap = new HashMap<String, String>(); if (null != deviceIds) { for (String deviceId : deviceIds) { deviceIdImageIdMap.put(deviceId, captureImage(deviceId, session, metaStbCache)); } } return deviceIdImageIdMap; }
VideoSnap { public Map<String, String> getCaptureImageIds(String[] deviceIds, HttpSession session, MetaStbCache metaStbCache) { Map<String, String> deviceIdImageIdMap = new HashMap<String, String>(); if (null != deviceIds) { for (String deviceId : deviceIds) { deviceIdImageIdMap.put(deviceId, captureImage(deviceId, session, metaStbCache)); } } return deviceIdImageIdMap; } }
VideoSnap { public Map<String, String> getCaptureImageIds(String[] deviceIds, HttpSession session, MetaStbCache metaStbCache) { Map<String, String> deviceIdImageIdMap = new HashMap<String, String>(); if (null != deviceIds) { for (String deviceId : deviceIds) { deviceIdImageIdMap.put(deviceId, captureImage(deviceId, session, metaStbCache)); } } return deviceIdImageIdMap; }  }
VideoSnap { public Map<String, String> getCaptureImageIds(String[] deviceIds, HttpSession session, MetaStbCache metaStbCache) { Map<String, String> deviceIdImageIdMap = new HashMap<String, String>(); if (null != deviceIds) { for (String deviceId : deviceIds) { deviceIdImageIdMap.put(deviceId, captureImage(deviceId, session, metaStbCache)); } } return deviceIdImageIdMap; }  void addImagesToZipFile(String[] capturedImageIds, String[] deviceMacs, HttpServletResponse response, HttpSession session); void saveSnappedImage(String imgId, String deviceId,
            HttpServletResponse response, HttpSession session); String captureImage(String deviceId, HttpSession session,
            MetaStbCache metaStbCache); Map<String, String> getCaptureImageIds(String[] deviceIds, HttpSession session, MetaStbCache metaStbCache); }
VideoSnap { public Map<String, String> getCaptureImageIds(String[] deviceIds, HttpSession session, MetaStbCache metaStbCache) { Map<String, String> deviceIdImageIdMap = new HashMap<String, String>(); if (null != deviceIds) { for (String deviceId : deviceIds) { deviceIdImageIdMap.put(deviceId, captureImage(deviceId, session, metaStbCache)); } } return deviceIdImageIdMap; }  void addImagesToZipFile(String[] capturedImageIds, String[] deviceMacs, HttpServletResponse response, HttpSession session); void saveSnappedImage(String imgId, String deviceId,
            HttpServletResponse response, HttpSession session); String captureImage(String deviceId, HttpSession session,
            MetaStbCache metaStbCache); Map<String, String> getCaptureImageIds(String[] deviceIds, HttpSession session, MetaStbCache metaStbCache);  }