Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ env_vars: {
key: "BUILD_SUBDIR"
value: "google-auth-library-java"
}

env_vars: {
key: "INTEGRATION_TEST_ARGS"
value: "-Pslf4j2x"
}

2 changes: 1 addition & 1 deletion gapic-libraries-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-bom</artifactId>
<version>6.116.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>6.116.1</version><!-- {x-version-update:google-cloud-spanner:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
8 changes: 8 additions & 0 deletions google-auth-library-java/appengine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<skipNativeTests>true</skipNativeTests>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,22 +614,28 @@ private Clock createMockClock(RefreshType refreshType, GoogleCredentials sourceC
// Set mocked time so that the token is fresh and no refresh is needed (before the refresh
// margin).
mockedTimeInMillis = expirationTimeInMillis - refreshMarginInMillis - 60000;
when(mockClock.currentTimeMillis()).thenReturn(mockedTimeInMillis);
break;
case ASYNC:
// Set mocked time so that the token is nearing expiry and an async refresh is triggered
// (within the refresh margin).
mockedTimeInMillis = expirationTimeInMillis - refreshMarginInMillis + 60000;
when(mockClock.currentTimeMillis())
.thenReturn(
mockedTimeInMillis, // First call: Stale (triggers the async refresh)
currentTimeInMillis // Subsequent calls: Fresh (skips redundant refreshes)
);
break;
case BLOCKING:
// Set mocked time so that the token requires immediate refresh (just after the minimum
// token lifetime).
mockedTimeInMillis = expirationTimeInMillis - minimumTokenLifetimeMillis + 60000;
when(mockClock.currentTimeMillis()).thenReturn(mockedTimeInMillis);
break;
default:
throw new IllegalArgumentException("Unexpected RefreshType: " + refreshType);
}

when(mockClock.currentTimeMillis()).thenReturn(mockedTimeInMillis);
return mockClock;
}

Expand Down
7 changes: 7 additions & 0 deletions google-auth-library-java/credentials/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
<sourceDirectory>java</sourceDirectory>
<testSourceDirectory>javatests</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<skipNativeTests>true</skipNativeTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
Loading