justinmclean opened a new issue, #8010:
URL: https://github.com/apache/gravitino/issues/8010
### What would you like to be improved?
In
bundles/gcp/src/test/java/org/apache/gravitino/gcs/credential/TestGCSTokenProvider.java
the GCS token provider’s resource path enumeration needs to be corrected so
that multi-level paths accumulate whole parent segments.
This modified test shows the issue:
```
@Test
void testGetAllResources() {
Map<String, List<String>> checkResults =
ImmutableMap.<String, List<String>>builder()
.put("a/b", Arrays.asList("a", "a/", "a/b"))
.put("a/b/", Arrays.asList("a", "a/", "a/b"))
.put("a/b/c", Arrays.asList("a", "a/", "a/b", "a/b/", "a/b/c"))
.put("a/b/c/", Arrays.asList("a", "a/", "a/b", "a/b/", "a/b/c"))
.put("a", Arrays.asList("a"))
.put("a/", Arrays.asList("a"))
.put("", Arrays.asList(""))
.put("/", Arrays.asList(""))
.build();
checkResults.forEach(
(key, value) -> {
List<String> parentResources =
GCSTokenProvider.getAllResources(key);
Assertions.assertArrayEquals(value.toArray(),
parentResources.toArray());
});
}
```
### How should we improve?
Fix getAllResources in
bundles/gcp/src/main/java/org/apache/gravitino/gcs/credential/GCSTokenProvider.java
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]