/** * Loads a specified bean by type, used to retrieve an annotated bean to test from the underlying implementation * * @param beanClass The type to load * @return The loaded bean */ protected final <T> T getBeanByType(Class<T> beanClass) { if (beanProvider == null) { throw new IllegalStateException("No tests should be run if beanProvider is null"); } return beanProvider.getBeanByType(beanClass); } }
/** * Loads a specified bean by type, used to retrieve an annotated bean to test from the * underlying implementation * * @param beanClass * The type to load * @return The loaded bean */ protected final <T> T getBeanByType(Class<T> beanClass) { if (beanProvider == null) { throw new IllegalStateException( "No tests should be run if beanProvider is null"); } return beanProvider.getBeanByType(beanClass); } }