### Question:
Supervisor implements IOFogModule { private void startModule(IOFogModule ioFogModule) throws Exception { logInfo(" Starting " + ioFogModule.getModuleName()); StatusReporter.setSupervisorStatus().setModuleStatus(ioFogModule.getModuleIndex(), STARTING); ioFogModule.start(); StatusReporter.setSupervisorStatus().setModuleStatus(ioFogModule.getModuleIndex(), RUNNING); logInfo(" Started " + ioFogModule.getModuleName()); } Supervisor(); void start(); @Override int getModuleIndex(); @Override String getModuleName();  }### Answer:
@Test public void testStartModule() throws Exception{ resourceManager = mock(ResourceManager.class); PowerMockito.when(resourceManager.getModuleIndex()).thenReturn(6); PowerMockito.when(resourceManager.getModuleName()).thenReturn("ResourceManager"); PowerMockito.when(StatusReporter.setSupervisorStatus().setModuleStatus(6, STARTING)).thenReturn(mock(SupervisorStatus.class)); PowerMockito.when(StatusReporter.setSupervisorStatus().setModuleStatus(6, RUNNING)).thenReturn(null); method = Supervisor.class.getDeclaredMethod("startModule", IOFogModule.class); method.setAccessible(true); PowerMockito.doNothing().when(resourceManager).start(); method.invoke(supervisor, resourceManager); verify(supervisor, Mockito.atLeastOnce()).logInfo(" Starting ResourceManager"); verify(supervisor, Mockito.atLeastOnce()).logInfo(" Started ResourceManager"); }