@Test public void testEnrollReqToJsonAttrEmptyName() throws Exception { thrown.expect(InvalidArgumentException.class); thrown.expectMessage("name may not be null or empty."); EnrollmentRequest testEnrollReq = new EnrollmentRequest(); testEnrollReq.addAttrReq(""); }
public void addAttrReq() throws InvalidArgumentException { if (attrreqs != null && !attrreqs.isEmpty()) { throw new InvalidArgumentException("Attributes have already been defined."); } attrreqs = new HashMap<>(); }
EnrollmentRequest { public void addAttrReq() throws InvalidArgumentException { if (attrreqs != null && !attrreqs.isEmpty()) { throw new InvalidArgumentException("Attributes have already been defined."); } attrreqs = new HashMap<>(); } }
EnrollmentRequest { public void addAttrReq() throws InvalidArgumentException { if (attrreqs != null && !attrreqs.isEmpty()) { throw new InvalidArgumentException("Attributes have already been defined."); } attrreqs = new HashMap<>(); } EnrollmentRequest();  EnrollmentRequest(String profile, String label, KeyPair keypair); }
EnrollmentRequest { public void addAttrReq() throws InvalidArgumentException { if (attrreqs != null && !attrreqs.isEmpty()) { throw new InvalidArgumentException("Attributes have already been defined."); } attrreqs = new HashMap<>(); } EnrollmentRequest();  EnrollmentRequest(String profile, String label, KeyPair keypair); void setCsr(String csr); void setKeyPair(KeyPair keypair); String getProfile(); void setProfile(String profile); String getLabel(); void setLabel(String label); Collection<String> getHosts(); void addHost(String host); void addAttrReq(); AttrReq addAttrReq(String name); }
EnrollmentRequest { public void addAttrReq() throws InvalidArgumentException { if (attrreqs != null && !attrreqs.isEmpty()) { throw new InvalidArgumentException("Attributes have already been defined."); } attrreqs = new HashMap<>(); } EnrollmentRequest();  EnrollmentRequest(String profile, String label, KeyPair keypair); void setCsr(String csr); void setKeyPair(KeyPair keypair); String getProfile(); void setProfile(String profile); String getLabel(); void setLabel(String label); Collection<String> getHosts(); void addHost(String host); void addAttrReq(); AttrReq addAttrReq(String name);  }