summaryrefslogtreecommitdiffstats
path: root/common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/context/TaskFactoryTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/context/TaskFactoryTest.java')
-rw-r--r--common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/context/TaskFactoryTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/context/TaskFactoryTest.java b/common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/context/TaskFactoryTest.java
new file mode 100644
index 0000000000..1649302056
--- /dev/null
+++ b/common/openecomp-logging-lib/openecomp-logging-core/src/test/java/org/openecomp/core/logging/context/TaskFactoryTest.java
@@ -0,0 +1,26 @@
+package org.openecomp.core.logging.context;
+
+import org.openecomp.core.logging.api.context.TaskFactory;
+import org.testng.annotations.Test;
+
+import java.lang.reflect.Field;
+
+import static org.testng.Assert.assertEquals;
+
+/**
+ * @author evitaliy
+ * @since 12/09/2016.
+ */
+public class TaskFactoryTest {
+
+ @Test
+ public void testCreate() throws Exception {
+ // test that the service loader loads the right implementation
+ TaskFactory.create(() -> {
+ });
+ Field factory = TaskFactory.class.getDeclaredField("SERVICE");
+ factory.setAccessible(true);
+ Object implementation = factory.get(null);
+ assertEquals(MdcPropagationService.class, implementation.getClass());
+ }
+} \ No newline at end of file