}
@Test
public void testUpdate() throws Exception {
ResourceInstance resource = createMock(ResourceInstance.class);
ResourceDefinition resourceDefinition = createMock(ResourceDefinition.class);
ClusterController controller = createMock(ClusterController.class);
Schema schema = createMock(Schema.class);
Request serverRequest = createStrictMock(Request.class);
Query query = createMock(Query.class);
Predicate predicate = createMock(Predicate.class);
RequestBody body = new RequestBody();
Map<String, Object> mapProperties = new HashMap<String, Object>();
mapProperties.put(PropertyHelper.getPropertyId("foo", "bar"), "value");
NamedPropertySet namedPropSet = new NamedPropertySet("", mapProperties);
body.addPropertySet(namedPropSet);
Set<Map<String, Object>> setExpected = new HashSet<Map<String, Object>>();
setExpected.add(mapProperties);
//expectations
expect(resource.getResourceDefinition()).andReturn(resourceDefinition);
expect(resourceDefinition.getType()).andReturn(Resource.Type.Component);
expect(resource.getQuery()).andReturn(query);
expect(query.getPredicate()).andReturn(predicate);
expect(controller.updateResources(Resource.Type.Component, serverRequest, predicate)).andReturn(new RequestStatusImpl(null));