[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / common / openecomp-logging-lib / openecomp-logging-core / src / test / java / org / openecomp / core / logging / LoggerFactoryTest.java
1 package org.openecomp.core.logging;
2
3 import org.openecomp.core.logging.api.LoggerFactory;
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 LoggerFactoryTest {
15
16   @Test
17   public void testCreate() throws Exception {
18     // test that the service loader loads the right implementation
19     LoggerFactory.getLogger(LoggerFactoryTest.class);
20     Field factory = LoggerFactory.class.getDeclaredField("SERVICE");
21     factory.setAccessible(true);
22     Object implementation = factory.get(null);
23     assertEquals(Slf4JLoggerCreationService.class, implementation.getClass());
24   }
25 }