PppoeClientManager { public boolean configClient(String ssid, String paramName, String paramValue) { if (paramName.equals(ADMIN_STATE)) { try { PppoeAdminState state = PppoeAdminState.valueOf(paramValue.toUpperCase()); PppoeClientInfo clientInfo = clients.get(ssid); if (clientInfo == null) { clientInfo = new PppoeClientInfo(state); clientInfo.setServiceSpecificId(ssid); clients.put(ssid, clientInfo); return true; } clientInfo.setAdminState(state); clientInfo.setConfigured(true); if (clientInfo.deviceId() == null) { return true; } return updateClient(clientInfo); } catch (Exception e) { checkArgument(false, "Invalid parameter value %s", paramValue); return false; } } else { PppoeClientInfo clientInfo = clients.get(ssid); if ((clientInfo == null) || (clientInfo.deviceId() == null)) { log.error("No PPPoE client device for SSID {}", ssid); return false; } clientInfo.setEndSession(true); return updateClient(clientInfo); } } PppoeClientManager(DeviceService deviceService, DriverService driverService,
                              MastershipService mastershipService, AccessDeviceService accessDeviceService); boolean configClient(String ssid, String paramName, String paramValue); Collection<PppoeClientInfo> getClients(String ssid); Collection<PppoeSessionInfo> getSessions(); void addClient(PppoeDeviceInfo deviceInfo); void removeClient(PppoeDeviceInfo deviceInfo);  }
@Test public void testconfigClientSessionNotEstablish() throws Exception { assertTrue("Incorrect response", clientManager.configClient(ssid, "admin-state", "enable")); assertFalse("Incorrect response", clientManager.configClient(ssid, "end-session", "")); }