Fixed refresh token expiry test

Change-Id: I40b9cd1de8ca0015bedb051bd5d3f6a5b3f4833e
diff --git a/.gitignore b/.gitignore
index 6c081c8..1e8daea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,5 @@
 
 # FB specific Kustvakt.conf
 src\main\resources\Kustvakt.conf
+/temp/
+/icc-index/
diff --git a/full/Changes b/full/Changes
index d18590e..5f94e14 100644
--- a/full/Changes
+++ b/full/Changes
@@ -4,6 +4,7 @@
 - Added an admin service to load and cache system vc (solved #268)
 - Move oauth2 admin service path (closed #544) 
 - Excluded admin service to load-cache VC from the test suite
+- Fixed refresh token expiry test
 
 # version 0.69.2
 
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java
index 0717d8e..4621bef 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java
@@ -19,12 +19,14 @@
 import org.apache.oltu.oauth2.common.message.types.GrantType;
 import org.apache.oltu.oauth2.common.message.types.TokenType;
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.google.common.net.HttpHeaders;
 
 import de.ids_mannheim.korap.authentication.http.HttpAuthorizationHandler;
 import de.ids_mannheim.korap.config.Attributes;
+import de.ids_mannheim.korap.config.FullConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.oauth2.constant.OAuth2Error;
 import de.ids_mannheim.korap.oauth2.entity.AccessScope;
@@ -37,6 +39,9 @@
  */
 public class OAuth2ControllerTest extends OAuth2TestBase {
 
+    @Autowired
+    public FullConfiguration config;
+    
     public String userAuthHeader;
 
     public OAuth2ControllerTest () throws KustvaktException {
@@ -973,7 +978,8 @@
     private void testRefreshTokenExpiry (String refreshToken)
             throws KustvaktException {
         RefreshToken token = refreshTokenDao.retrieveRefreshToken(refreshToken);
-        ZonedDateTime expiry = token.getCreatedDate().plusDays(365);
+        ZonedDateTime expiry = token.getCreatedDate()
+                .plusSeconds(config.getRefreshTokenLongExpiry());
         assertTrue(expiry.equals(token.getExpiryDate()));
     }
 }