Enhancements for the aai-common library
[aai/aai-common.git] / aai-els-onap-logging / src / main / java / org / onap / aai / util / AAIConfigProxy.java
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+package org.onap.aai.util;
 
-package org.onap.aai.logging;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-
-import org.junit.*;
-
-public class EcompErrorCategoryTest {
-
-    EcompErrorCategory _ecompErrorCategory;
-    ILoggingEvent mockEvent;
-
-    @Before
-    public void setUp() throws Exception {
-
-        mockEvent = mock(ILoggingEvent.class);
-        _ecompErrorCategory = spy(EcompErrorCategory.class);
+/**
+ * <b>AAIConfigProxy</b> is a interface trying to proxy calls
+ * to the AAIConfig class in which there are only static methods
+ * The main reason for this interface existence is to simplify
+ * unit testing edge cases in which it is harder to simulate
+ *
+ * Note: If there is a better way to do this,
+ * it is encouraged to change this early on
+ */
+// TODO - Find an better name for this interface name
+public interface AAIConfigProxy {
 
+    default String get(String key, String defaultValue){
+        return AAIConfig.get(key, defaultValue);
     }
 
-    @Test
-    public void warn() {
-        String defaultCategory = "WARN";
-        assertEquals(_ecompErrorCategory.convert(mockEvent), defaultCategory);
+    default int getInt(String key, String defaultValue){
+        return AAIConfig.getInt(key, defaultValue);
     }
-
 }