Skip to content

Commit

Permalink
Running secure storage manager tests only on relevant systems
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astachowski committed Nov 7, 2024
1 parent 7641cc7 commit f53ba90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/java/net/snowflake/client/annotations/RunOnMac.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.snowflake.client.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@EnabledOnOs(OS.MAC)
public @interface RunOnMac {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import java.util.Iterator;
import java.util.Map;
import net.snowflake.client.annotations.RunOnLinux;
import net.snowflake.client.annotations.RunOnMac;
import net.snowflake.client.annotations.RunOnWindows;
import net.snowflake.client.annotations.RunOnWindowsOrMac;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -236,6 +238,7 @@ public void testLoadNativeLibrary() {
}

@Test
@RunOnWindows
public void testWindowsManager() {
SecureStorageWindowsManager.Advapi32LibManager.setInstance(new MockAdvapi32Lib());
SecureStorageManager manager = SecureStorageWindowsManager.builder();
Expand All @@ -245,6 +248,7 @@ public void testWindowsManager() {
}

@Test
@RunOnMac
public void testMacManager() {
SecureStorageAppleManager.SecurityLibManager.setInstance(new MockSecurityLib());
SecureStorageManager manager = SecureStorageAppleManager.builder();
Expand Down

0 comments on commit f53ba90

Please sign in to comment.