expect(mockReader.getName()).andReturn(SERVICE).anyTimes();
expect(mockReader.getAttributeValue(null, "name")).andReturn(name);
expect(mockReader.next()).andReturn(END_ELEMENT);
expect(mockReader.getName()).andReturn(SERVICE).anyTimes();
replay(mockReader);
ServiceDefinition serviceDefinition = loader.load(null, mockReader, null);
assertNotNull(serviceDefinition);
assertEquals(name, serviceDefinition.getName());
}