blob: 1649302056a48746e8eeb17e74b69376360c6441 (
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.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());
}
}
|