storage.put("state", State.Stopped.name());
storage.save();
replay(storage);
final List<ServiceRegistration> wires = new LinkedList<ServiceRegistration>();
ServiceAssembly sa = new ServiceAssemblyImpl(null, descriptor, new ArrayList<ServiceUnitImpl>(), storage, new AssemblyReferencesListener(), false) {
@Override
protected ServiceRegistration registerWire(Wire wire) {
ServiceRegistration registration = createMock(ServiceRegistration.class);
wires.add(registration);
return registration;
}
};
sa.start();
assertEquals(2, wires.size());
// ServiceRegistrations should be unregistered when the SA is stopped
for (final ServiceRegistration registration : wires) {
registration.unregister();
replay(registration);
}
sa.stop();
}