diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/LdapServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/impl/LdapServiceTest.java
index 9a3a56e0c07225da8ad49d3aa02e434b0cbf2268..aed2843e3766f38ca14aae5e39fdf98cf698a0b9 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/LdapServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/LdapServiceTest.java
@@ -39,7 +39,7 @@ public class LdapServiceTest extends ServiceTestFunctions {
       configurationService.setConfigurationValue(ConfigurationElementType.LDAP_OBJECT_CLASS, "person");
       configurationService.setConfigurationValue(ConfigurationElementType.LDAP_FILTER, "memberof=cn=gitlab,cn=groups,cn=accounts,dc=uni,dc=lu");
 
-      ldapService = Mockito.spy(LdapService.class);
+      ldapService = Mockito.spy(new LdapService(null));
       ldapService.setConfigurationService(configurationService);
       Mockito.when(ldapService.getConnection()).thenAnswer(new Answer<LDAPConnection>() {
 
diff --git a/service/src/test/java/lcsb/mapviewer/services/impl/UserServiceTest.java b/service/src/test/java/lcsb/mapviewer/services/impl/UserServiceTest.java
index a88b5900d35b3afd17e55770c2eaaf6144c72b8f..652b835f3b20b1dd1ab7a183aa09837231f0b97e 100644
--- a/service/src/test/java/lcsb/mapviewer/services/impl/UserServiceTest.java
+++ b/service/src/test/java/lcsb/mapviewer/services/impl/UserServiceTest.java
@@ -89,7 +89,7 @@ public class UserServiceTest extends ServiceTestFunctions {
     configurationService.setConfigurationValue(ConfigurationElementType.LDAP_FILTER,
         "memberof=cn=gitlab,cn=groups,cn=accounts,dc=uni,dc=lu");
 
-    LdapService ldapService = Mockito.spy(LdapService.class);
+    LdapService ldapService = Mockito.spy(new LdapService(null));
     ldapService.setConfigurationService(configurationService);
     Mockito.when(ldapService.getConnection()).thenAnswer(new Answer<LDAPConnection>() {