### Question:
UpdateControlPointPositionCommand extends AbstractControlPointCommand { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { checkUpdateControlPoint(getEdgeControlPoints(context).getControlPoints(), controlPoints); return GraphCommandResultBuilder.SUCCESS; } UpdateControlPointPositionCommand(final @MapsTo("edgeUUID") String edgeUUID,
                                             final @MapsTo("controlPoints") ControlPoint[] controlPoints); @Override CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context);  }### Answer:
@Test public void testCheck() { tested = new UpdateControlPointPositionCommand(EDGE_UUID, newControlPoints); CommandResult<RuleViolation> result = tested.check(graphCommandExecutionContext); assertFalse(CommandUtils.isError(result)); }
@Test(expected = IllegalArgumentException.class) public void testCannotUpdateCPs() { newControlPoints = new ControlPoint[]{newControlPoint1, newControlPoint2}; tested = new UpdateControlPointPositionCommand(EDGE_UUID, newControlPoints); tested.check(graphCommandExecutionContext); }
@Test(expected = IllegalArgumentException.class) public void testCannotUpdateCPs2() { when(viewConnector.getControlPoints()).thenReturn(new ControlPoint[]{controlPoint1, controlPoint2}); tested = new UpdateControlPointPositionCommand(EDGE_UUID, newControlPoints); tested.check(graphCommandExecutionContext); }