@Test public void testHandleOperation() throws Exception { UserId userId = mock(UserId.class); 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); conditionManager.handleOperation(userId,operation); }
public void handleOperation(UserId userId, Operation operation) { if (!conditionHandlers.containsKey(userId)) { conditionHandlers.put(userId, new ConditionHandlerImpl(intentResolver, userId)); } conditionHandlers.get(userId).handleCondition(operation); }
ConditionManager implements IConditionManager { public void handleOperation(UserId userId, Operation operation) { if (!conditionHandlers.containsKey(userId)) { conditionHandlers.put(userId, new ConditionHandlerImpl(intentResolver, userId)); } conditionHandlers.get(userId).handleCondition(operation); } }
ConditionManager implements IConditionManager { public void handleOperation(UserId userId, Operation operation) { if (!conditionHandlers.containsKey(userId)) { conditionHandlers.put(userId, new ConditionHandlerImpl(intentResolver, userId)); } conditionHandlers.get(userId).handleCondition(operation); } ConditionManager(IntentResolver intentResolver); }
ConditionManager implements IConditionManager { public void handleOperation(UserId userId, Operation operation) { if (!conditionHandlers.containsKey(userId)) { conditionHandlers.put(userId, new ConditionHandlerImpl(intentResolver, userId)); } conditionHandlers.get(userId).handleCondition(operation); } ConditionManager(IntentResolver intentResolver); void handleOperation(UserId userId, Operation operation); void clear(UserId userId); }
ConditionManager implements IConditionManager { public void handleOperation(UserId userId, Operation operation) { if (!conditionHandlers.containsKey(userId)) { conditionHandlers.put(userId, new ConditionHandlerImpl(intentResolver, userId)); } conditionHandlers.get(userId).handleCondition(operation); } ConditionManager(IntentResolver intentResolver); void handleOperation(UserId userId, Operation operation); void clear(UserId userId);  }