DaemonOperation extends Operation { private DaemonOperationResult executeList() { logger.log(Level.INFO, "Listing daemon-managed folders ..."); loadOrCreateConfig(); return new DaemonOperationResult(DaemonResultCode.OK, daemonConfig.getFolders()); } DaemonOperation();  DaemonOperation(DaemonOperationOptions options); @Override DaemonOperationResult execute(); @Subscribe void onControlCommand(ControlCommand controlCommand); @Subscribe void onControlManagementRequest(ControlManagementRequest controlRequest); static final String PID_FILE; }
@Test public void testExecuteList() throws Exception { when(options.getAction()).thenReturn(DaemonAction.LIST); DaemonOperationResult res = deamonOp.execute(); assertNotNull(res); assertEquals(DaemonResultCode.OK, res.getResultCode()); assertNotNull(res.getWatchList()); }