improve ClassPathScannerTest to illustrate how it binds 2 interfaces
authorMichael Vorburger <mike@vorburger.ch>
Sat, 22 Dec 2018 01:20:58 +0000 (02:20 +0100)
committerMichael Vorburger <mike@vorburger.ch>
Wed, 1 Jul 2020 23:38:14 +0000 (01:38 +0200)
Signed-off-by: Michael Vorburger <mike@vorburger.ch>
src/test/java/org/opendaylight/infrautils/inject/tests/ClassPathScannerTest.java
src/test/java/org/opendaylight/infrautils/inject/tests/ClassPathScannerTestAnotherInterface.java [new file with mode: 0644]
src/test/java/org/opendaylight/infrautils/inject/tests/ClassPathScannerTestImplementation.java

index f2cfb056f71f841e7ad12a02b848e2dbe21ad3de..f95d19f97802363e704632524dc1afd86b6ed4e7 100644 (file)
@@ -23,6 +23,7 @@ public class ClassPathScannerTest {
         Map<Class<?>, Class<?>> bindings = new HashMap<>();
         new ClassPathScanner(PREFIX).bindAllSingletons(PREFIX, bindings::put);
         assertThat(bindings).containsExactly(
-                ClassPathScannerTestTopInterface.class, ClassPathScannerTestImplementation.class);
+                ClassPathScannerTestTopInterface.class, ClassPathScannerTestImplementation.class,
+                ClassPathScannerTestAnotherInterface.class, ClassPathScannerTestImplementation.class);
     }
 }
diff --git a/src/test/java/org/opendaylight/infrautils/inject/tests/ClassPathScannerTestAnotherInterface.java b/src/test/java/org/opendaylight/infrautils/inject/tests/ClassPathScannerTestAnotherInterface.java
new file mode 100644 (file)
index 0000000..342758d
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+ * Copyright © 2018 Red Hat, Inc. and others.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.infrautils.inject.tests;
+
+public interface ClassPathScannerTestAnotherInterface {
+}
index 2598a63f012d208c7cce545f438424cc41a9e507..205ab5c4e7c83a7320bb6d19518b04c0db05ecac 100644 (file)
@@ -10,5 +10,6 @@ package org.opendaylight.infrautils.inject.tests;
 import javax.inject.Singleton;
 
 @Singleton
-public class ClassPathScannerTestImplementation implements ClassPathScannerTestTopInterface {
+public class ClassPathScannerTestImplementation
+        implements ClassPathScannerTestTopInterface, ClassPathScannerTestAnotherInterface {
 }