@SuppressWarnings("unchecked")
public void testUpgradeWithPlatformDeletedOnServer_V2() throws Exception {
final FakeServerInventory inv = (FakeServerInventory) PluginContainerTest
.getServerSideFake(UPGRADE_WITH_PLATFORM_DELETED_ON_SERVER_TEST);
final ServerServices ss = PluginContainerTest.getCurrentPluginContainerConfiguration().getServerServices();
PluginContainerTest.getCurrentMockContext().checking(new Expectations() {
{
defineDefaultExpectations(inv, this);
//the first merge will be triggered from within the upgrade process and we are
//going to report null sync.
oneOf(ss.getDiscoveryServerService()).mergeInventoryReport(with(any(InventoryReport.class)));
will(inv.clearPlatform());
//the rest of the inventory merges are executed by discoveries, so let's import the
//discovered stuff into the server-side inventory.
allowing(ss.getDiscoveryServerService()).mergeInventoryReport(with(any(InventoryReport.class)));
will(inv.mergeInventoryReport(InventoryStatus.COMMITTED));
allowing(ss.getDiscoveryServerService()).getResourceSyncInfo(with(any(Integer.class)));
will(inv.getResourceSyncInfo());
never(ss.getDiscoveryServerService()).upgradeResources(with(any(Set.class)));
}
});
PluginContainerTest.startConfiguredPluginContainer();