summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/src/test/java/org/openecomp/sdc/logging/context/TaskFactoryTest.java
blob: dad60d44d5ea1e02ed618b942bbfb5a1b7616199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.openecomp.sdc.logging.context;

import org.openecomp.sdc.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());
  }
}