1 package org.openecomp.core.logging.api.context;
3 import org.testng.annotations.Test;
5 import java.util.ServiceLoader;
7 import static org.testng.Assert.*;
13 public class TaskFactoryTest {
15 @Test(expectedExceptions = RuntimeException.class)
16 public void testNoImplementation() throws Exception {
18 assertFalse(ServiceLoader.load(ContextPropagationService.class).iterator().hasNext());
21 TaskFactory.create(() -> {
23 } catch (RuntimeException e) {
24 Throwable cause = e.getCause();
26 assertTrue(cause.getMessage().contains(ContextPropagationService.class.getName()));