Ejemplo n.º 1
0
 @Override
 public boolean apply(Instance input) {
   if (emptyString.equals(input.getProductCodes())) input.getProductCodes().clear();
   if (input.getIp() != null && "".equals(input.getIp().trim())) input.setIp(null);
   else if (input.getIp() != null && input.getIp().endsWith(" "))
     input.setIp(input.getIp().trim());
   if (input.getHostname() != null && "".equals(input.getHostname().trim()))
     input.setHostname(null);
   else if (input.getHostname() != null && input.getHostname().endsWith(" "))
     input.setHostname(input.getHostname().trim());
   return true;
 }
 private void assertIpHostAndStatusACTIVE(Instance instance) {
   assertNotNull(instance.getIp());
   assertNotNull(instance.getHostname());
   assertEquals(instance.getStatus(), Instance.Status.ACTIVE);
 }
 private void assertIpHostNullAndStatusNEW(Instance instance) {
   assertEquals(instance.getIp(), null);
   assertEquals(instance.getHostname(), null);
   assertEquals(instance.getStatus(), Instance.Status.NEW);
 }