SpringBeanService { public void removeBeanDefinitions(File configFile, Project project, Class<?> type) { removeBeanDefinitions(configFile, project, type, null, null); }  List<File> getConfigImports(File configFile, Project project); T getBeanDefinition(File configFile, Project project, String id, Class<T> type); List<T> getBeanDefinitions(File configFile, Project project, Class<T> type); List<T> getBeanDefinitions(File configFile, Project project, Class<T> type, Map<String, String> attributes); List<String> getBeanNames(File configFile, Project project, String beanType); void addBeanDefinition(File configFile, Project project, Object jaxbElement); void removeBeanDefinition(File configFile, Project project, String id); void removeBeanDefinitions(File configFile, Project project, Class<?> type); void removeBeanDefinitions(File configFile, Project project, Class<?> type, String attributeName, String attributeValue); void updateBeanDefinition(File configFile, Project project, String id, Object jaxbElement); void updateBeanDefinitions(File configFile, Project project, Class<?> type, Object jaxbElement); void updateBeanDefinitions(File configFile, Project project, Class<?> type, Object jaxbElement, String attributeName, String attributeValue); void setSpringBeanMarshaller(SpringBeanMarshaller springBeanMarshaller); static final String FAILED_TO_UPDATE_BEAN_DEFINITION; static final String UNABLE_TO_READ_TRANSFORMATION_SOURCE; }
@Test public void testRemoveSpringBeanDefinitions() throws Exception { File tempFile = createTempContextFile("citrus-context-remove-bean"); springBeanConfigService.removeBeanDefinitions(tempFile, project, SpringBean.class, "class", "com.consol.citrus.DeleteMe"); String result = FileUtils.readToString(new FileInputStream(tempFile)); Assert.assertTrue(result.contains("id=\"preserveMe\""), "Failed to validate " + result); Assert.assertTrue(result.contains("name=\"preserveMeName\""), "Failed to validate " + result); Assert.assertFalse(result.contains("<bean id=\"deleteMe\""), "Failed to validate " + result); Assert.assertFalse(result.contains("<bean name=\"deleteMeName\""), "Failed to validate " + result); Assert.assertTrue(result.contains("<bean class=\"com.consol.citrus.SampleClass\""), "Failed to validate " + result); Assert.assertFalse(result.contains("<bean class=\"com.consol.citrus.DeleteMe\""), "Failed to validate " + result); Assert.assertTrue(result.contains("<property name=\"class\" value=\"com.consol.citrus.DeleteMe\"/>"), "Failed to validate " + result); }