@Test
void testManagementLifecycle() {
//Test that the ManagementLifeCycle module properly listens for view creation events and context destruction.
ManagementContext managementContext = createMock(ManagementContext.class);
managementContext.register(anyObject(Compute.class));
expectLastCall().once();
managementContext.manage(anyObject(ComputeManagement.class), eq("testname"));
expectLastCall().once();
managementContext.unmanage(anyObject(ComputeManagement.class), eq("testname"));
expectLastCall().once();
managementContext.unregister(anyObject(Compute.class));
expectLastCall().once();
replay(managementContext);
Compute compute = ContextBuilder.newBuilder(new JcloudsTestComputeProviderMetadata()).name("testname")
.credentials("user", "password")