You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an error running mvm install locally during tests, with no code modification having been done. I believe the issue is that ScheduledExecutorService is not mocked. Clock based services (or the Clock they depend upon) should be mocked due to variances in clock speeds on different machines. Using sleep is inaccurate.
if (this.isActive())
throw new IllegalStateException("Already started");
// fetching from a remote service will inevitably pose some delay so we
// defensively choose to count the fetch time from the very start.
T newToken = this.getTokenService().fetch();
if (newToken == null)
throw new IllegalStateException("The token fetched from this TokenService is null");
TemporalAccessToken<T> accessToken = new TemporalAccessToken<>(newToken, Instant.now(), this.tokenExpireInTemporalUnit());
this.fireTokenUpdate(accessToken, null);
this.tokenRenewTask = new TokenRenewTask(this, accessToken);
long delayMillis = this.estimatedRepetitionsDelay().toMillis();
Error is
Running net.oauth2.client.AutoRenewingTokenProviderTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Tests run: 16, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.782 sec <<< FAILURE! - in net.oauth2.client.AutoRenewingTokenProviderTest
test(net.oauth2.client.AutoRenewingTokenProviderTest) Time elapsed: 0.085 sec <<< FAILURE!
org.mockito.exceptions.verification.TooManyActualInvocations:
tokenChangeObserver.tokenChanged(
<Capturing argument>,
<Capturing argument>
);
Wanted 3 times:
-> at net.oauth2.client.AutoRenewingTokenProviderTest.test(AutoRenewingTokenProviderTest.java:377)
But was 4 times. Undesired invocation:
-> at net.oauth2.client.AutoRenewingTokenProvider.lambda$fireTokenUpdate$0(AutoRenewingTokenProvider.java:175)
at net.oauth2.client.AutoRenewingTokenProviderTest.test(AutoRenewingTokenProviderTest.java:377)
The text was updated successfully, but these errors were encountered:
I get an error running
mvm install
locally during tests, with no code modification having been done. I believe the issue is thatScheduledExecutorService
is not mocked. Clock based services (or theClock
they depend upon) should be mocked due to variances in clock speeds on different machines. Usingsleep
is inaccurate.Error is
The text was updated successfully, but these errors were encountered: