TelnetUtils implements AutoCloseable { public void configL3vpnOnDeviceByCli(String deviceName, String clearOldConfigString, String cliExecutionSequences){ setConfigOver(Boolean.FALSE); setInstanceOfClearCliTemplate(clearOldConfigString); setInstanceOfNewCliTemplate(cliExecutionSequences); setCurrentDeviceName(deviceName); clearOldConfig(); } TelnetUtils(); @Override void close(); static Boolean isClearOver(); static void setClearOver(Boolean clearOver); static String getInstanceOfClearCliTemplate(); static void setInstanceOfClearCliTemplate(String instanceOfClearCliTemplate); static String getInstanceOfNewCliTemplate(); static void setInstanceOfNewCliTemplate(String instanceOfNewCliTemplate); static String getCurrentDeviceName(); static void setCurrentDeviceName(String currentDeviceName); static Boolean isConfigOver(); static void setConfigOver(Boolean configOver); void configL3vpnOnDeviceByCli(String deviceName,
                                     String clearOldConfigString,
                                     String cliExecutionSequences);  }
@Test public void testConfigL3vpnOnDeviceByCli() throws Exception { String deviceName = new String("deviceNamePE1"); String clearOldConfigString = new String("clearOldConfigString"); String cliExecutionSequences = new String("cliExecutionSequences"); telnetUtils.configL3vpnOnDeviceByCli(deviceName,clearOldConfigString,cliExecutionSequences); Assert.assertTrue(!TelnetUtils.isConfigOver()); Assert.assertEquals(TelnetUtils.getInstanceOfClearCliTemplate(), "clearOldConfigString"); Assert.assertEquals(TelnetUtils.getInstanceOfNewCliTemplate(),"cliExecutionSequences"); Assert.assertEquals(TelnetUtils.getCurrentDeviceName(),"deviceNamePE1"); }