'``ApplicationNodeDeployer.calculate_changes`` specifies that an
application must be stopped when it is running but not desired.'

def test_application_needs_stopping(self):

    api = ApplicationNodeDeployer(u'node.example.com', docker_client=FakeDockerClient())
    to_stop = StopApplication(application=Application(name=u'site-example.com', image=DockerImage.from_string(u'flocker/wordpress')))
    node_state = NodeState(hostname=api.hostname, applications={to_stop.application})
    result = api.calculate_changes(desired_configuration=EMPTY, current_cluster_state=DeploymentState(nodes=[node_state]), local_state=NodeLocalState(node_state=node_state))
    expected = sequentially(changes=[in_parallel(changes=[to_stop])])
    self.assertEqual(expected, result)
