// +1 because it will have one for current state
AssertJUnit.assertEquals(resources.length + 1, resourceMap.size());
for (int i = 0; i < resources.length; i++) {
String resourceName = resources[i];
ResourceId resourceId = ResourceId.from(resourceName);
IdealState idealState = idealStates.get(i);
AssertJUnit.assertTrue(resourceMap.containsKey(resourceId));
AssertJUnit.assertEquals(resourceMap.get(resourceId).getId(), resourceId);
AssertJUnit.assertEquals(resourceMap.get(resourceId).getIdealState().getStateModelDefId(),
idealState.getStateModelDefId());
AssertJUnit.assertEquals(resourceMap.get(resourceId).getSubUnitSet().size(),
idealState.getNumPartitions());
}
// Test the data derived from CurrentState
ResourceId oldResourceId = ResourceId.from(oldResource);
AssertJUnit.assertTrue(resourceMap.containsKey(oldResourceId));
AssertJUnit.assertEquals(resourceMap.get(oldResourceId).getId(), oldResourceId);
AssertJUnit.assertEquals(resourceMap.get(oldResourceId).getIdealState().getStateModelDefId(),
currentState.getStateModelDefId());
AssertJUnit.assertEquals(resourceMap.get(oldResourceId).getSubUnitSet().size(), currentState