ServiceReference compReference = deployment.getDomain().getServiceReference(
new QName("urn:test:config-mock-binding:1.0", "NoService/TestReference"));
Assert.assertNotNull(compReference.getServiceMetadata().getRegistrant());
Assert.assertTrue(compReference.getServiceMetadata().getRegistrant().getConfig() instanceof ComponentImplementationModel);
ServiceRegistry registry = ((DomainImpl) deployment.getDomain()).getServiceRegistry();
deployment.stop();
// ensure we're cleaning up after ourselves.
Assert.assertEquals(0, registry.getServices().size());
Assert.assertEquals(0, registry.getServiceReferences().size());
deployment.destroy();
}