@Test public void testRemoveSshSession() { when(sshGlobalSessionObjectMock.getResource()).thenReturn(resourceMock); when(resourceMock.get()).thenReturn(mapMock); CacheUtils.removeSshSession(sshGlobalSessionObjectMock, sessionId); CacheUtils.removeSshSession(null, null); CacheUtils.removeSshSession(null, ""); verify(mapMock, Mockito.times(1)).remove(Mockito.anyString()); }
public static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) { if (sessionParam != null) { SessionResource<Map<String, SSHConnection>> resource = sessionParam.getResource(); if (resource != null) { Map<String, SSHConnection> tempMap = resource.get(); if (tempMap != null) { tempMap.remove(sessionId); } } } }
CacheUtils { public static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) { if (sessionParam != null) { SessionResource<Map<String, SSHConnection>> resource = sessionParam.getResource(); if (resource != null) { Map<String, SSHConnection> tempMap = resource.get(); if (tempMap != null) { tempMap.remove(sessionId); } } } } }
CacheUtils { public static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) { if (sessionParam != null) { SessionResource<Map<String, SSHConnection>> resource = sessionParam.getResource(); if (resource != null) { Map<String, SSHConnection> tempMap = resource.get(); if (tempMap != null) { tempMap.remove(sessionId); } } } }  }
CacheUtils { public static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) { if (sessionParam != null) { SessionResource<Map<String, SSHConnection>> resource = sessionParam.getResource(); if (resource != null) { Map<String, SSHConnection> tempMap = resource.get(); if (tempMap != null) { tempMap.remove(sessionId); } } } }  static boolean saveSshSessionAndChannel(Session session, Channel channel, GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId); static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId); static SSHService getFromCache(SessionResource<Map<String, SSHConnection>> sessionResource, String sessionId); }
CacheUtils { public static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) { if (sessionParam != null) { SessionResource<Map<String, SSHConnection>> resource = sessionParam.getResource(); if (resource != null) { Map<String, SSHConnection> tempMap = resource.get(); if (tempMap != null) { tempMap.remove(sessionId); } } } }  static boolean saveSshSessionAndChannel(Session session, Channel channel, GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId); static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId); static SSHService getFromCache(SessionResource<Map<String, SSHConnection>> sessionResource, String sessionId);  }