### Question:
JAXRSCdiResourceExtension implements Extension { public void injectBus(@Observes final AfterBeanDiscovery event, final BeanManager beanManager) { if (!hasBus) { final AnnotatedType< ExtensionManagerBus > busAnnotatedType = beanManager.createAnnotatedType(ExtensionManagerBus.class); final InjectionTarget<ExtensionManagerBus> busInjectionTarget = beanManager.createInjectionTarget(busAnnotatedType); event.addBean(new CdiBusBean(busInjectionTarget)); } if (applicationBeans.isEmpty() && !serviceBeans.isEmpty()) { final DefaultApplicationBean applicationBean = new DefaultApplicationBean(); applicationBeans.add(applicationBean); event.addBean(applicationBean); } else { existingStandardClasses.add(Application.class.getName()); } InjectionUtils.STANDARD_CONTEXT_CLASSES.stream() .map(this::toClass) .filter(Objects::nonNull) .forEach(contextTypes::add); contextTypes.addAll(getCustomContextClasses()); contextTypes.forEach( t -> event.addBean(new ContextProducerBean(t, !existingStandardClasses.contains(t.getTypeName())))); }  Collection<String> getExistingStandardClasses(); void convertContextsToCdi(@Observes @WithAnnotations({Context.class})
                                             ProcessAnnotatedType<X> processAnnotatedType); @SuppressWarnings("unchecked") void collect(@Observes final ProcessBean< T > event); void collect(@Observes final ProcessProducerField< T, X > event); void collect(@Observes final ProcessProducerMethod< T, X > event); void load(@Observes final AfterDeploymentValidation event, final BeanManager beanManager); void injectBus(@Observes final AfterBeanDiscovery event, final BeanManager beanManager); void registerCreationalContextForDisposal(@Observes final DisposableCreationalContext event); void release(@Observes final BeforeShutdown event); static Set<Class<?>> getCustomContextClasses();  }### Answer:
@Test public void shouldNotAddDefaultApplicationWhenNoResourcesDefined() { extension.injectBus(event, beanManager); verify(event).addBean(any(CdiBusBean.class)); verify(event, never()).addBean(any(DefaultApplicationBean.class)); }