Skip to content

Commit

Permalink
Fix setter for serverUri to use URI type
Browse files Browse the repository at this point in the history
Signed-off-by: szymonorz <szyorz@proton.me>
  • Loading branch information
szymonorz committed Oct 22, 2024
1 parent 157f4ff commit 3b16199
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,9 @@ public Optional<URI> getServerUri()

@Config("iceberg.rest-catalog.oauth2.server-uri")
@ConfigDescription("The endpoint to retrieve access token from OAuth2 Server")
public OAuth2SecurityConfig setServerUri(String uri)
public OAuth2SecurityConfig setServerUri(URI serverUri)
{
if (uri != null) {
this.serverUri = URI.create(uri);
}
this.serverUri = serverUri;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.common.collect.ImmutableMap;
import org.junit.jupiter.api.Test;

import java.net.URI;
import java.util.Map;

import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping;
Expand Down Expand Up @@ -49,7 +50,7 @@ public void testExplicitPropertyMappings()
.setCredential("credential")
.setToken("token")
.setScope("scope")
.setServerUri("http://localhost:8080/realms/iceberg/protocol/openid-connect/token");
.setServerUri(URI.create("http://localhost:8080/realms/iceberg/protocol/openid-connect/token"));
assertThat(expected.credentialOrTokenPresent()).isTrue();
assertThat(expected.scopePresentOnlyWithCredential()).isFalse();
assertFullMapping(properties, expected);
Expand Down

0 comments on commit 3b16199

Please sign in to comment.