Skip to content

Commit 61fa4b3

Browse files
committed
only execute KWallet test, if DISPLAY env variable is present
1 parent 6fa6352 commit 61fa4b3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test/java/org/cryptomator/linux/keychain/KDEWalletKeychainAccessTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.junit.jupiter.api.Assertions;
44
import org.junit.jupiter.api.BeforeAll;
55
import org.junit.jupiter.api.Test;
6+
import org.junit.jupiter.api.condition.EnabledIf;
67
import org.junit.jupiter.api.condition.EnabledOnOs;
78
import org.junit.jupiter.api.condition.OS;
89

@@ -14,6 +15,7 @@
1415
* Unit tests for KWallet access via DBUS.
1516
*/
1617
@EnabledOnOs(OS.LINUX)
18+
@EnabledIf("osEnvironmentSuitable")
1719
public class KDEWalletKeychainAccessTest {
1820

1921
private static boolean isInstalled;
@@ -40,4 +42,9 @@ public void testIsSupported() {
4042
KDEWalletKeychainAccess keychainAccess = new KDEWalletKeychainAccess();
4143
Assertions.assertEquals(isInstalled, keychainAccess.isSupported());
4244
}
45+
46+
47+
private static boolean osEnvironmentSuitable() {
48+
return System.getenv().containsKey("DISPLAY");
49+
}
4350
}

0 commit comments

Comments
 (0)