Skip to content

Commit

Permalink
keep a mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
lizk886 committed Jul 15, 2024
1 parent c75b988 commit 64a68e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ public void loadContent() throws Exception {
}

public Collection<S3Key> getKeysForSite(Integer siteId) {
return siteToKeysMap.getOrDefault(siteId, Collections.emptyList());
Map<Integer, S3Key> allKeys = getAll();
return allKeys.values().stream()
.filter(key -> key.getSiteId()==(siteId))
.collect(Collectors.toList());
}

public S3Key getEncryptionKeyForSite(Integer siteId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ public void captureUnknownPath(Vertx vertx, VertxTestContext testContext) {

@ParameterizedTest
@MethodSource("siteIdRoutingContextData")
public void getSiteIdFromRoutingContextData(String key, Object value, String siteId, Vertx vertx, VertxTestContext testContext) {
public void

getSiteIdFromRoutingContextData(String key, Object value, String siteId, Vertx vertx, VertxTestContext testContext) {
Router router = Router.router(vertx);
router.route().handler(new RequestCapturingHandler());
router.get("/test").handler(ctx -> {
Expand Down

0 comments on commit 64a68e2

Please sign in to comment.