diff --git a/data-prepper-plugin-framework/src/test/java/org/opensearch/dataprepper/plugin/PluginBeanFactoryProviderTest.java b/data-prepper-plugin-framework/src/test/java/org/opensearch/dataprepper/plugin/PluginBeanFactoryProviderTest.java index d48e9eb64a..614c91f756 100644 --- a/data-prepper-plugin-framework/src/test/java/org/opensearch/dataprepper/plugin/PluginBeanFactoryProviderTest.java +++ b/data-prepper-plugin-framework/src/test/java/org/opensearch/dataprepper/plugin/PluginBeanFactoryProviderTest.java @@ -9,6 +9,7 @@ import org.junit.jupiter.api.Test; import org.opensearch.dataprepper.plugins.test.TestComponent; import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.context.support.GenericApplicationContext; import static org.hamcrest.CoreMatchers.equalTo; @@ -112,5 +113,6 @@ void testInitializePluginSpecificIsolatedContext_with_empty_array() { final PluginBeanFactoryProvider objectUnderTest = createObjectUnderTest(); BeanFactory beanFactory = objectUnderTest.initializePluginSpecificIsolatedContext(new Class[]{}); assertThat(beanFactory, notNullValue()); + assertThrows(NoSuchBeanDefinitionException.class, ()->beanFactory.getBean(TestComponent.class)); } } \ No newline at end of file