diff --git a/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java b/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java
index 0eec7e1..bdb3bc7 100644
--- a/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java
+++ b/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java
@@ -91,19 +91,8 @@
         }
         AAIMicroServiceAuthCore.reloadUsers();
 
-        TimerTask task = new FileWatcher(new File(policyAuthFileName)) {
-            @Override
-            protected void onChange(File file) {
-                // here we implement the onChange
-                applicationLogger.debug("File " + file.getName() + " has been changed!");
-                try {
-                    AAIMicroServiceAuthCore.reloadUsers();
-                } catch (AAIAuthException e) {
-                    applicationLogger.error(ApplicationMsgs.PROCESS_REQUEST_ERROR, e);
-                }
-                applicationLogger.debug("File " + file.getName() + " has been reloaded!");
-            }
-        };
+
+        TimerTask task = new AuthFileWatcher(new File(policyAuthFileName));
 
         if (!timerSet) {
             timerSet = true;
@@ -130,7 +119,7 @@
      * <li>If this fails, try resolving the path relative to the configuration home location (either
      * <code>$CONFIG_HOME</code> or <code>$APP_HOME/appconfig</code>).</li>
      * <li>If this fails try resolving relative to the <code>auth</code> folder under configuration home.</li>
-     * 
+     *
      * @param authPolicyFile
      *            filename or path
      * @return the Optional canonical path to the located policy file
diff --git a/src/main/java/org/onap/aai/auth/AuthFileWatcher.java b/src/main/java/org/onap/aai/auth/AuthFileWatcher.java
new file mode 100644
index 0000000..07b522d
--- /dev/null
+++ b/src/main/java/org/onap/aai/auth/AuthFileWatcher.java
@@ -0,0 +1,46 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.aai.auth;
+
+import java.io.File;
+import org.onap.aai.babel.logging.ApplicationMsgs;
+import org.onap.aai.babel.logging.LogHelper;
+
+public class AuthFileWatcher extends FileWatcher {
+
+    private static LogHelper applicationLogger = LogHelper.INSTANCE;
+
+    public AuthFileWatcher(File file) {
+        super(file);
+    }
+
+    @Override
+    protected void onChange(File file) {
+        applicationLogger.debug("File " + file.getName() + " has been changed!");
+        try {
+            AAIMicroServiceAuthCore.reloadUsers();
+        } catch (AAIAuthException e) {
+            applicationLogger.error(ApplicationMsgs.PROCESS_REQUEST_ERROR, e);
+        }
+        applicationLogger.debug("File " + file.getName() + " has been reloaded!");
+    }
+}
diff --git a/src/test/java/org/onap/aai/babel/TestAuthFileWatcher.java b/src/test/java/org/onap/aai/babel/TestAuthFileWatcher.java
new file mode 100644
index 0000000..e213e15
--- /dev/null
+++ b/src/test/java/org/onap/aai/babel/TestAuthFileWatcher.java
@@ -0,0 +1,81 @@
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2017-2019 European Software Marketing Ltd.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.aai.babel;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.junit.Assert.assertThat;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.TimerTask;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.onap.aai.auth.AAIAuthException;
+import org.onap.aai.auth.AAIMicroServiceAuth;
+import org.onap.aai.auth.AAIMicroServiceAuthCore;
+import org.onap.aai.auth.AuthFileWatcher;
+import org.onap.aai.babel.config.BabelAuthConfig;
+
+/**
+ * Tests {@link AuthFileWatcher}.
+ */
+
+public class TestAuthFileWatcher {
+
+    private TimerTask task;
+    private File mockFile = Mockito.mock(File.class);
+
+    @Before
+    public void createTask() {
+        task = new AuthFileWatcher(mockFile);
+    }
+
+    @Test
+    public void testOnChangeDoesNotRun() {
+        task.run();
+    }
+
+    @Test
+    public void testOnChangeDoesRun() throws IOException, AAIAuthException {
+        System.setProperty("CONFIG_HOME", "src/test/resources");
+        BabelAuthConfig babelServiceAuthConfig = new BabelAuthConfig();
+        babelServiceAuthConfig.setAuthPolicyFile("auth_policy.json");
+        new AAIMicroServiceAuth(babelServiceAuthConfig);
+
+        Mockito.when(mockFile.lastModified()).thenReturn(1000L);
+        task.run();
+    }
+
+    @Test
+    public void testOnChangeRunAfterFailure() throws IOException {
+        File file = File.createTempFile("auth-policy", "json");
+        try {
+            AAIMicroServiceAuthCore.init(file.getAbsolutePath());
+        } catch (AAIAuthException e) {
+            assertThat(e.getMessage(), containsString("Error processing Auth policy file"));
+        }
+        Mockito.when(mockFile.lastModified()).thenReturn(1000L);
+        task.run();
+    }
+
+}
