[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / common / openecomp-logging-lib / openecomp-logging-core / src / test / java / org / openecomp / core / logging / context / TaskFactoryTest.java
1 package org.openecomp.core.logging.context;
2
3 import org.openecomp.core.logging.api.context.TaskFactory;
4 import org.testng.annotations.Test;
5
6 import java.lang.reflect.Field;
7
8 import static org.testng.Assert.assertEquals;
9
10 /**
11  * @author evitaliy
12  * @since 12/09/2016.
13  */
14 public class TaskFactoryTest {
15
16   @Test
17   public void testCreate() throws Exception {
18     // test that the service loader loads the right implementation
19     TaskFactory.create(() -> {
20     });
21     Field factory = TaskFactory.class.getDeclaredField("SERVICE");
22     factory.setAccessible(true);
23     Object implementation = factory.get(null);
24     assertEquals(MdcPropagationService.class, implementation.getClass());
25   }
26 }