CGroupsBlkioResourceHandlerImpl implements DiskResourceHandler { @Override public List<PrivilegedOperation> postComplete(ContainerId containerId) throws ResourceHandlerException { cGroupsHandler.deleteCGroup(CGroupsHandler.CGroupController.BLKIO, containerId.toString()); return null; } CGroupsBlkioResourceHandlerImpl(CGroupsHandler cGroupsHandler); @Override List<PrivilegedOperation> bootstrap(Configuration configuration); @Override List<PrivilegedOperation> preStart(Container container); @Override List<PrivilegedOperation> reacquireContainer(ContainerId containerId); @Override List<PrivilegedOperation> updateContainer(Container container); @Override List<PrivilegedOperation> postComplete(ContainerId containerId); @Override List<PrivilegedOperation> teardown(); @Override String toString();  }
@Test public void testPostComplete() throws Exception { String id = "container_01_01"; ContainerId mockContainerId = mock(ContainerId.class); when(mockContainerId.toString()).thenReturn(id); Assert.assertNull(cGroupsBlkioResourceHandlerImpl .postComplete(mockContainerId)); verify(mockCGroupsHandler, times(1)).deleteCGroup( CGroupsHandler.CGroupController.BLKIO, id); }