You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/10/26 10:28:35 UTC
[camel] 04/04: CAMEL-20042: camel-spring - Autowire @Primary beans supported
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch primary-spring
in repository https://gitbox.apache.org/repos/asf/camel.git
commit f6708f65e7274778610fa35a273d9ef5c62858bf
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Oct 26 12:28:16 2023 +0200
CAMEL-20042: camel-spring - Autowire @Primary beans supported
---
.../org/apache/camel/spring/primary/FindSingleByTypeTest.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/components/camel-spring-xml/src/test/java/org/apache/camel/spring/primary/FindSingleByTypeTest.java b/components/camel-spring-xml/src/test/java/org/apache/camel/spring/primary/FindSingleByTypeTest.java
index d72feb88fb0..0483037a2b4 100644
--- a/components/camel-spring-xml/src/test/java/org/apache/camel/spring/primary/FindSingleByTypeTest.java
+++ b/components/camel-spring-xml/src/test/java/org/apache/camel/spring/primary/FindSingleByTypeTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.camel.spring.primary;
+import java.util.Set;
+
import org.apache.camel.ContextTestSupport;
import org.apache.camel.NoSuchBeanTypeException;
import org.apache.camel.model.ModelCamelContext;
@@ -65,6 +67,15 @@ public class FindSingleByTypeTest extends ContextTestSupport {
Assertions.assertNull(o);
}
+ @Test
+ public void testFindByType() {
+ // should find primary
+ Set<Customer> set = context.getRegistry().findByType(Customer.class);
+
+ // should find both beans
+ Assertions.assertEquals(2, set.size());
+ }
+
@Test
public void testFindSingleMandatory() {
// should find primary