HostBO { public boolean configureWhiteListFromCustomData(WhitelistConfigurationData hostConfigObj) { if (hostConfigObj.getChallengeHex() == null || hostConfigObj.getChallengeHex().isEmpty()) { return configureWhiteListFromCustomData(hostConfigObj, null); } else if (Digest.sha1().isValidHex(hostConfigObj.getChallengeHex())) { Nonce challenge = new Nonce(Digest.sha1().valueHex(hostConfigObj.getChallengeHex()).getBytes()); return configureWhiteListFromCustomData(hostConfigObj, challenge); } else { log.error("Invalid challenge: {}", hostConfigObj.getChallengeHex()); throw new IllegalArgumentException("Invalid challenge"); } } HostBO(); String getPlatformName(String processorNameOrCPUID); boolean registerHost(TxtHostRecord hostObj); HostConfigResponseList registerHosts(TxtHostRecordList hostRecords); HostConfigResponseList registerHosts(HostConfigDataList hostRecords); boolean registerHostFromCustomData(HostConfigData hostConfigObj); boolean configureWhiteListFromHost(TxtHostRecord gkvHost); boolean configureWhiteListFromCustomData(WhitelistConfigurationData hostConfigObj); boolean configureWhiteListFromCustomData(WhitelistConfigurationData hostConfigObj, Nonce challenge); String getNextAvailableBIOSMLEName(String biosName, String biosVersion, String oemName); String getNextAvailableVMMMLEName(String vmmName, String vmmVersion, String osName, String osVersion);  }
@Test public void testConfigureWhiteListUsingCustomData() { HostConfigData wlObj = new HostConfigData(); TxtHostRecord gkvHost = new TxtHostRecord(); gkvHost.HostName = "10.1.71.154"; gkvHost.AddOn_Connection_String = "vmware:https: wlObj.setTxtHostRecord(gkvHost); wlObj.setBiosPCRs("0,17"); wlObj.setVmmPCRs("18,19,20"); wlObj.setBiosWhiteList(true); wlObj.setVmmWhiteList(true); wlObj.setBiosWLTarget(HostWhiteListTarget.BIOS_OEM); wlObj.setVmmWLTarget(HostWhiteListTarget.VMM_OEM); wlObj.setRegisterHost(false); HostBO instance = MSComponentFactory.getHostBO(); WhitelistConfigurationData newCustomObj = new WhitelistConfigurationData(wlObj); newCustomObj.setBiosMleName(""); newCustomObj.setVmmMleName(""); HostConfigData newHCData = new HostConfigData(newCustomObj); System.out.println(newHCData.toString()); HostConfigData newHCData2 = newCustomObj; newHCData2.setBiosPCRs("0,1,2,17"); System.out.println(newHCData2.toString()); newCustomObj = (WhitelistConfigurationData) newHCData2; boolean result = instance.configureWhiteListFromCustomData(newCustomObj); System.out.println(result); }