@@ -89,7 +89,6 @@ public static void setupClass() {
89
89
90
90
@ BeforeEach
91
91
public void setup () throws IOException {
92
- System .setProperty ("os.name" , "Linux" );
93
92
computeEngineCredentials = Mockito .mock (ComputeEngineCredentials .class );
94
93
}
95
94
@@ -686,6 +685,7 @@ void testLogDirectPathMisconfigNotOnGCE() throws Exception {
686
685
687
686
@ Test
688
687
public void canUseDirectPath_happyPath () {
688
+ System .setProperty ("os.name" , "Linux" );
689
689
EnvironmentProvider envProvider = Mockito .mock (EnvironmentProvider .class );
690
690
Mockito .when (
691
691
envProvider .getenv (
@@ -704,6 +704,7 @@ public void canUseDirectPath_happyPath() {
704
704
705
705
@ Test
706
706
public void canUseDirectPath_directPathEnvVarDisabled () {
707
+ System .setProperty ("os.name" , "Linux" );
707
708
EnvironmentProvider envProvider = Mockito .mock (EnvironmentProvider .class );
708
709
Mockito .when (
709
710
envProvider .getenv (
@@ -722,6 +723,7 @@ public void canUseDirectPath_directPathEnvVarDisabled() {
722
723
723
724
@ Test
724
725
public void canUseDirectPath_directPathEnvVarNotSet_attemptDirectPathIsTrue () {
726
+ System .setProperty ("os.name" , "Linux" );
725
727
InstantiatingGrpcChannelProvider .Builder builder =
726
728
InstantiatingGrpcChannelProvider .newBuilder ()
727
729
.setAttemptDirectPath (true )
@@ -734,6 +736,7 @@ public void canUseDirectPath_directPathEnvVarNotSet_attemptDirectPathIsTrue() {
734
736
735
737
@ Test
736
738
public void canUseDirectPath_directPathEnvVarNotSet_attemptDirectPathIsFalse () {
739
+ System .setProperty ("os.name" , "Linux" );
737
740
InstantiatingGrpcChannelProvider .Builder builder =
738
741
InstantiatingGrpcChannelProvider .newBuilder ()
739
742
.setAttemptDirectPath (false )
@@ -746,6 +749,7 @@ public void canUseDirectPath_directPathEnvVarNotSet_attemptDirectPathIsFalse() {
746
749
747
750
@ Test
748
751
public void canUseDirectPath_nonComputeCredentials () {
752
+ System .setProperty ("os.name" , "Linux" );
749
753
Credentials credentials = Mockito .mock (Credentials .class );
750
754
EnvironmentProvider envProvider = Mockito .mock (EnvironmentProvider .class );
751
755
Mockito .when (
@@ -784,6 +788,7 @@ public void canUseDirectPath_isNotOnComputeEngine_invalidOsNameSystemProperty()
784
788
785
789
@ Test
786
790
public void canUseDirectPath_isNotOnComputeEngine_invalidSystemProductName () {
791
+ System .setProperty ("os.name" , "Linux" );
787
792
EnvironmentProvider envProvider = Mockito .mock (EnvironmentProvider .class );
788
793
Mockito .when (
789
794
envProvider .getenv (
@@ -802,6 +807,7 @@ public void canUseDirectPath_isNotOnComputeEngine_invalidSystemProductName() {
802
807
803
808
@ Test
804
809
public void canUseDirectPath_isNotOnComputeEngine_unableToGetSystemProductName () {
810
+ System .setProperty ("os.name" , "Linux" );
805
811
EnvironmentProvider envProvider = Mockito .mock (EnvironmentProvider .class );
806
812
Mockito .when (
807
813
envProvider .getenv (
@@ -819,6 +825,7 @@ public void canUseDirectPath_isNotOnComputeEngine_unableToGetSystemProductName()
819
825
820
826
@ Test
821
827
public void canUseDirectPath_nonGDUUniverseDomain () {
828
+ System .setProperty ("os.name" , "Linux" );
822
829
EnvironmentProvider envProvider = Mockito .mock (EnvironmentProvider .class );
823
830
Mockito .when (
824
831
envProvider .getenv (
0 commit comments