@Test public void testRule() throws Exception { Rule rule = new Rule(); rule.setCidr("cidr"); rule.setFromPort("fromport"); rule.setIdParent("idparent"); rule.setIdRule("idrule"); rule.setSourceGroup("sourcegroup"); rule.setToPort("toPort"); rule.setIpProtocol("ipProtocol"); assertEquals(rule.getCidr(), "cidr"); assertEquals(rule.getFromPort(), "fromport"); assertEquals(rule.getIdParent(), "idparent"); assertEquals(rule.getIdRule(), "idrule"); assertEquals(rule.getSourceGroup(), "sourcegroup"); assertNotNull(rule.toJSON()); }
public String toJSON() { return "{\"security_group\": \n" + "{" + "\"name\": \"" + name + "\", " + "\"description\": \"" + description + "\" " + "}" + "}"; }
SecurityGroup { public String toJSON() { return "{\"security_group\": \n" + "{" + "\"name\": \"" + name + "\", " + "\"description\": \"" + description + "\" " + "}" + "}"; } }
SecurityGroup { public String toJSON() { return "{\"security_group\": \n" + "{" + "\"name\": \"" + name + "\", " + "\"description\": \"" + description + "\" " + "}" + "}"; } SecurityGroup();  SecurityGroup(String name, String description); }
SecurityGroup { public String toJSON() { return "{\"security_group\": \n" + "{" + "\"name\": \"" + name + "\", " + "\"description\": \"" + description + "\" " + "}" + "}"; } SecurityGroup();  SecurityGroup(String name, String description); void addRule(Rule rule); void deleteRule(Rule rule); @SuppressWarnings("unchecked") void fromJson(JSONObject jsonNode); String getDescription(); String getIdSecurityGroup(); String getName(); List<Rule> getRules(); void setDescription(String description); void setIdSecurityGroup(String idSecurityGroup); void setName(String name); void setRules(List<Rule> rules); Long getId(); List<Rule> cloneRules(); String toJSON(); String toString(); }
SecurityGroup { public String toJSON() { return "{\"security_group\": \n" + "{" + "\"name\": \"" + name + "\", " + "\"description\": \"" + description + "\" " + "}" + "}"; } SecurityGroup();  SecurityGroup(String name, String description); void addRule(Rule rule); void deleteRule(Rule rule); @SuppressWarnings("unchecked") void fromJson(JSONObject jsonNode); String getDescription(); String getIdSecurityGroup(); String getName(); List<Rule> getRules(); void setDescription(String description); void setIdSecurityGroup(String idSecurityGroup); void setName(String name); void setRules(List<Rule> rules); Long getId(); List<Rule> cloneRules(); String toJSON(); String toString();  }