Skip to content

Commit

Permalink
Bump redis-authx-core & redis-authx-entraid from 0.1.0-SNAPSHOT to 0.…
Browse files Browse the repository at this point in the history
…1.1-beta1
  • Loading branch information
ggivo committed Dec 20, 2024
1 parent a2a8e10 commit 668b850
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 32 deletions.
34 changes: 4 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,6 @@
<tag>HEAD</tag>
</scm>

<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
Expand Down Expand Up @@ -186,39 +173,26 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>redis.clients.authentication</groupId>
<artifactId>redis-authx-core</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>redis.clients.authentication</groupId>
<artifactId>redis-authx-entraid</artifactId>
<version>0.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>dotenv-java</artifactId>
<version>2.2.0</version>
<scope>test</scope>
</dependency>

</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>redis.clients.authentication</groupId>
<artifactId>redis-authx-core</artifactId>
<version>0.1.1-beta1</version>
</dependency>
<dependency>
<groupId>redis.clients.authentication</groupId>
<artifactId>redis-authx-entraid</artifactId>
<version>0.1.1-beta1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>dotenv-java</artifactId>
<version>2.2.0</version>
<scope>test</scope>
</dependency>
<!-- Start of core dependencies -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
import redis.clients.authentication.core.SimpleToken;
import redis.clients.authentication.core.TokenManagerConfig;

import java.time.Duration;
import java.util.Collections;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TokenBasedRedisCredentialsProviderTest {

Expand All @@ -24,7 +27,9 @@ public class TokenBasedRedisCredentialsProviderTest {
@BeforeEach
public void setUp() {
// Use TestToken manager to emit tokens/errors on request
tokenManager = new TestTokenManager(null, null);
TokenManagerConfig tokenManagerConfig = mock(TokenManagerConfig.class);
when(tokenManagerConfig.getRetryPolicy()).thenReturn(mock(TokenManagerConfig.RetryPolicy.class));
tokenManager = new TestTokenManager(null, tokenManagerConfig);
credentialsProvider = TokenBasedRedisCredentialsProvider.create(tokenManager);
}

Expand Down Expand Up @@ -112,6 +117,10 @@ public void shouldCompleteAllSubscribersOnStop() {
StepVerifier.create(credentialsFlux2)
.assertNext(credentials -> assertThat(String.valueOf(credentials.getPassword())).isEqualTo("token-1"))
.verifyComplete();

assertThat(subscription1.isDisposed()).isTrue();
assertThat(subscription2.isDisposed()).isTrue();

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static io.lettuce.TestTags.INTEGRATION_TEST;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import javax.inject.Inject;

Expand All @@ -26,6 +28,7 @@
import io.lettuce.test.settings.TestSettings;
import reactor.core.publisher.Mono;
import redis.clients.authentication.core.SimpleToken;
import redis.clients.authentication.core.TokenManagerConfig;

import java.time.Duration;
import java.time.Instant;
Expand Down Expand Up @@ -134,7 +137,9 @@ void tokenBasedCredentialProvider(RedisClient client) {
client.setOptions(client.getOptions().mutate()
.reauthenticateBehavior(ClientOptions.ReauthenticateBehavior.ON_NEW_CREDENTIALS).build());

TestTokenManager tokenManager = new TestTokenManager(null, null);
TokenManagerConfig tokenManagerConfig = mock(TokenManagerConfig.class);
when(tokenManagerConfig.getRetryPolicy()).thenReturn(mock(TokenManagerConfig.RetryPolicy.class));
TestTokenManager tokenManager = new TestTokenManager(null, tokenManagerConfig);
TokenBasedRedisCredentialsProvider credentialsProvider = TokenBasedRedisCredentialsProvider.create(tokenManager);

// Build RedisURI with streaming credentials provider
Expand Down

0 comments on commit 668b850

Please sign in to comment.