dad60d44d5ea1e02ed618b942bbfb5a1b7616199
[sdc.git] /
1 package org.openecomp.sdc.logging.context;
2
3 import org.openecomp.sdc.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 }