Set<String> seen = new HashSet<String>(2); // we use to this remember names of the things that we've seen
assert resourceType.getChildSubCategories() == null;
seen.clear();
ConfigurationDefinition pcDef = resourceType.getPluginConfigurationDefinition();
assert pcDef.getGroupDefinitions().size() == 2;
for (PropertyGroupDefinition group : pcDef.getGroupDefinitions()) {
seen.add(group.getName());
if (group.getName().equals(CHANGED_PC_GROUP)) {
assert group.isDefaultHidden() == CHANGED_PC_GROUP_HIDDEN;
} else if (group.getName().equals(NEW_PC_GROUP)) {
assert group.isDefaultHidden() == NEW_PC_GROUP_HIDDEN;
} else {
assert false : "Unexpected group [" + group.getName() + "]:" + group;
}
}
if (seen.size() != 2) {
assert false : "did not see what we expected to see: " + seen;
}
prop = pcDef.get(CHANGED_PC_PROP);
assert prop != null;
assert prop.getName().equals(CHANGED_PC_PROP);
assert prop.isRequired() == CHANGED_PC_PROP_REQUIRED;
assert prop.getPropertyGroupDefinition().getName().equals(CHANGED_PC_GROUP);
prop = pcDef.get(NEW_PC_PROP);
assert prop != null;
assert prop.getName().equals(NEW_PC_PROP);
assert prop.isRequired() == NEW_PC_PROP_REQUIRED;
assert prop.getPropertyGroupDefinition().getName().equals(NEW_PC_GROUP);