Delete temp file in FileWatcher test 82/84082/1
authormark.j.leonard <mark.j.leonard@gmail.com>
Wed, 3 Apr 2019 10:47:34 +0000 (11:47 +0100)
committermark.j.leonard <mark.j.leonard@gmail.com>
Wed, 3 Apr 2019 10:47:34 +0000 (11:47 +0100)
Ensure the temporary file is deleted after the test completes.

Change-Id: I25fbab4c28d9489df0ed9b6cb74a068873aa9854
Issue-ID: AAI-2280
Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
src/main/java/org/onap/aai/auth/AuthFileWatcher.java
src/test/java/org/onap/aai/babel/TestAuthFileWatcher.java

index 07b522d..cb5b8ca 100644 (file)
@@ -2,8 +2,8 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2019 European Software Marketing Ltd.
+ * 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.
index e213e15..4efb03e 100644 (file)
@@ -74,6 +74,7 @@ public class TestAuthFileWatcher {
         } catch (AAIAuthException e) {
             assertThat(e.getMessage(), containsString("Error processing Auth policy file"));
         }
+        file.deleteOnExit();
         Mockito.when(mockFile.lastModified()).thenReturn(1000L);
         task.run();
     }