	@Test
	public void testInternalCancel() throws Exception {

		// calling tested method
		instanceRegistry.internalCancel(APP_NAME, HOST_NAME, false);
		// event of proper type is registered
		assertEquals(1, this.testEvents.applicationEvents.size());
		assertTrue(this.testEvents.applicationEvents.get(0) instanceof EurekaInstanceCanceledEvent);
		// event details are correct
		final EurekaInstanceCanceledEvent registeredEvent =
				(EurekaInstanceCanceledEvent) (this.testEvents.applicationEvents.get(0));
		assertEquals(APP_NAME, registeredEvent.getAppName());
		assertEquals(HOST_NAME, registeredEvent.getServerId());
		assertEquals(instanceRegistry, registeredEvent.getSource());
		assertFalse(registeredEvent.isReplication());
	}