@Test public void testHandleCondition() throws Exception { Operation operation = mock(Operation.class); OperationId operationId = mock(OperationId.class); List<ConditionSegment> conditionSegments = new ArrayList<ConditionSegment>(); when(operation.getOperationId()).thenReturn(operationId); when(operationId.getValue()).thenReturn(new String("test")); when(operation.getConditionSegment()).thenReturn(conditionSegments); conditionHandler.handleCondition(operation); }
@Override public void handleCondition(Operation operation) { synchronized (mutex) { String name = operation.getOperationId().getValue(); Timer timer = new Timer("name"); ConditionMonitor conditionMonitor = new ConditionMonitor(intentResolver,userId,operation.getConditionSegment()); timer.schedule(conditionMonitor, 1, INTERVAL); timers.put(name, timer); } }
ConditionHandlerImpl implements IConditionHandler { @Override public void handleCondition(Operation operation) { synchronized (mutex) { String name = operation.getOperationId().getValue(); Timer timer = new Timer("name"); ConditionMonitor conditionMonitor = new ConditionMonitor(intentResolver,userId,operation.getConditionSegment()); timer.schedule(conditionMonitor, 1, INTERVAL); timers.put(name, timer); } } }
ConditionHandlerImpl implements IConditionHandler { @Override public void handleCondition(Operation operation) { synchronized (mutex) { String name = operation.getOperationId().getValue(); Timer timer = new Timer("name"); ConditionMonitor conditionMonitor = new ConditionMonitor(intentResolver,userId,operation.getConditionSegment()); timer.schedule(conditionMonitor, 1, INTERVAL); timers.put(name, timer); } } ConditionHandlerImpl(IntentResolver intentResolver,UserId userId); }
ConditionHandlerImpl implements IConditionHandler { @Override public void handleCondition(Operation operation) { synchronized (mutex) { String name = operation.getOperationId().getValue(); Timer timer = new Timer("name"); ConditionMonitor conditionMonitor = new ConditionMonitor(intentResolver,userId,operation.getConditionSegment()); timer.schedule(conditionMonitor, 1, INTERVAL); timers.put(name, timer); } } ConditionHandlerImpl(IntentResolver intentResolver,UserId userId); @Override void handleCondition(Operation operation); @Override void clearCondition(); @Override String toString(); }
ConditionHandlerImpl implements IConditionHandler { @Override public void handleCondition(Operation operation) { synchronized (mutex) { String name = operation.getOperationId().getValue(); Timer timer = new Timer("name"); ConditionMonitor conditionMonitor = new ConditionMonitor(intentResolver,userId,operation.getConditionSegment()); timer.schedule(conditionMonitor, 1, INTERVAL); timers.put(name, timer); } } ConditionHandlerImpl(IntentResolver intentResolver,UserId userId); @Override void handleCondition(Operation operation); @Override void clearCondition(); @Override String toString();  }