@Test
public void testQualifer() throws Exception {
getManager().getContext(ClassContext.class).activate(EnrichedClass.class);
fire(new BeforeSuite());
DroneContext context = getManager()
.getContext(ApplicationContext.class).getObjectStore().get(DroneContext.class);
Assert.assertNotNull("DroneContext was created in the context", context);
DroneRegistry registry = getManager().getContext(SuiteContext.class).getObjectStore().get(DroneRegistry.class);
Assert.assertNotNull("Drone registry was created in the context", registry);
Assert.assertTrue("Configurator is of mock type",
registry.getEntryFor(MockDrone.class, Configurator.class) instanceof MockDroneFactory);
Assert.assertTrue("Instantiator is of mock type",
registry.getEntryFor(MockDrone.class, Instantiator.class) instanceof MockDroneFactory);
fire(new BeforeClass(EnrichedClass.class));
DronePoint<MockDrone> invalidDronePoint = new DronePointImpl<MockDrone>(MockDrone.class,
DronePoint.Lifecycle.CLASS, AnnotationMocks.drone());
DronePoint<MockDrone> dronePoint = new DronePointImpl<MockDrone>(MockDrone.class, DronePoint.Lifecycle.CLASS,
AnnotationMocks.drone(), AnnotationMocks.differentQualifier());
MockDroneConfiguration configuration = context.get(dronePoint).getConfigurationAs(MockDroneConfiguration.class);
Assert.assertFalse("There is no MockDroneConfiguration with @Default qualifier",
context.get(invalidDronePoint).hasConfiguration());
Assert.assertNotNull("MockDroneConfiguration is stored with @Different qualifier", configuration);
Assert.assertEquals("MockDrone was configured from @Different configuration", DIFFERENT_FIELD,
configuration.getField());
getManager().getContext(ClassContext.class).deactivate();