resource.setName("ws-target-resource-basic-save-invalid");
ConnInstance connector = resourceDAO.find("ws-target-resource-1").getConnector();
resource.setConnector(connector);
UMapping mapping = new UMapping();
resource.setUmapping(mapping);
UMappingItem item = new UMappingItem();
item.setIntAttrName("fullname");
item.setExtAttrName("fullname");
item.setIntMappingType(IntMappingType.UserSchema);
item.setPurpose(MappingPurpose.BOTH);
mapping.setAccountIdItem(item);
item = new UMappingItem();
item.setIntAttrName("icon");
item.setExtAttrName("icon");
item.setIntMappingType(IntMappingType.RoleSchema);
item.setPurpose(MappingPurpose.BOTH);
mapping.addItem(item);
item = new UMappingItem();
item.setIntAttrName("mderiveddata");
item.setExtAttrName("mderiveddata");
item.setIntMappingType(IntMappingType.MembershipDerivedSchema);
item.setPurpose(MappingPurpose.BOTH);
mapping.addItem(item);
// save the resource
ExternalResource actual = resourceDAO.save(resource);
assertNotNull(actual);