Skip to content

Commit 923a2e1

Browse files
authored
Remove readInternalProperties helpers (#2506)
the functionality is already provided by the `PrincipalEntity`
1 parent 90c981a commit 923a2e1

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

runtime/service/src/test/java/org/apache/polaris/service/test/PolarisIntegrationTestFixture.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import static org.apache.polaris.service.context.TestRealmContextResolver.REALM_PROPERTY_KEY;
2222
import static org.assertj.core.api.Assertions.assertThat;
2323

24-
import com.fasterxml.jackson.core.JsonProcessingException;
25-
import com.fasterxml.jackson.core.type.TypeReference;
2624
import jakarta.ws.rs.client.Client;
2725
import jakarta.ws.rs.client.ClientBuilder;
2826
import jakarta.ws.rs.client.Entity;
@@ -113,9 +111,8 @@ private PolarisPrincipalSecrets fetchAdminSecrets() {
113111
PolarisMetaStoreManager metaStoreManager =
114112
helper.metaStoreManagerFactory.getOrCreateMetaStoreManager(realmContext);
115113
PrincipalEntity principal = metaStoreManager.findRootPrincipal(polarisContext).orElseThrow();
116-
Map<String, String> propertiesMap = readInternalProperties(principal);
117114
return metaStoreManager
118-
.loadPrincipalSecrets(polarisContext, propertiesMap.get("client_id"))
115+
.loadPrincipalSecrets(polarisContext, principal.getClientId())
119116
.getPrincipalSecrets();
120117
}
121118

@@ -213,15 +210,6 @@ public void destroy() {
213210
}
214211
}
215212

216-
private Map<String, String> readInternalProperties(PrincipalEntity principal) {
217-
try {
218-
return helper.objectMapper.readValue(
219-
principal.getInternalProperties(), new TypeReference<>() {});
220-
} catch (JsonProcessingException e) {
221-
throw new RuntimeException(e);
222-
}
223-
}
224-
225213
private static SnowmanIdentifier getSnowmanIdentifier(TestEnvironment testEnv) {
226214
return new SnowmanIdentifier("snowman" + testEnv.testId(), "catalog-admin" + testEnv.testId());
227215
}

runtime/service/src/test/java/org/apache/polaris/service/test/PolarisIntegrationTestHelper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
package org.apache.polaris.service.test;
2020

21-
import com.fasterxml.jackson.databind.ObjectMapper;
2221
import jakarta.inject.Inject;
2322
import jakarta.inject.Singleton;
2423
import org.apache.polaris.core.PolarisDiagnostics;
@@ -32,7 +31,6 @@ public class PolarisIntegrationTestHelper {
3231

3332
@Inject MetaStoreManagerFactory metaStoreManagerFactory;
3433
@Inject RealmContextResolver realmContextResolver;
35-
@Inject ObjectMapper objectMapper;
3634
@Inject PolarisDiagnostics diagServices;
3735
@Inject PolarisConfigurationStore configurationStore;
3836

0 commit comments

Comments
 (0)