@Test
public void testStopApplication() {

	new Context() {{
		new Within(duration("10 seconds")) {
			@Override
			protected void run() {
				try {
					initialize();
					register(Collections.<ResourceID>emptyList());
					watch(resourceManager.actor());
					resourceManager.tell(new StopCluster(ApplicationStatus.SUCCEEDED, ""), resourceManager);
					// verify that the Mesos framework is shutdown
					verify(schedulerDriver).stop(false);
					verify(workerStore).stop(true);
					expectTerminated(resourceManager.actor());
				} catch (Exception ex) {
					throw new RuntimeException(ex);
				}
			}
		};
	}};
}