Skip to content

Commit b6fe250

Browse files
committed
✅ Update test for MongoRequest with path template mount with trailing *
git status
1 parent 78fb486 commit b6fe250

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: commons/src/test/java/org/restheart/exchange/MongoRequestTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ public void testPathTemplatedMappedRequest() {
250250
*/
251251
@Test
252252
public void testPathTemplatedMappedRequestWithWildcard() {
253-
var requestPath = "/acme/coll/docid";
253+
var requestPath = "/acme/coll/docid/foo";
254254

255255
// Here mimic MongoService that attach PathTemplateMatch to the exchange
256256
PathTemplateMatcher<MongoMount> templateMongoMounts = new PathTemplateMatcher<>();
257-
String whatUri = "/restheart/{tenant}_{coll}";
258-
String whereUri = "/{tenant}/{coll}/*";
257+
String whatUri = "/restheart/{tenant}_{coll}/{*}";
258+
String whereUri = "/{tenant}/{coll}/{*}";
259259
var mongoMount = new MongoMount(whatUri,whereUri);
260260
templateMongoMounts.add(mongoMount.uri, mongoMount);
261261

@@ -268,7 +268,7 @@ public void testPathTemplatedMappedRequestWithWildcard() {
268268

269269
MongoRequest request = MongoRequest.init(ex, whereUri, whatUri);
270270

271-
assertEquals("/restheart/acme_coll/docid", request.getUnmappedRequestUri());
271+
assertEquals("/restheart/acme_coll/docid/foo", request.getMongoResourceUri());
272272
assertEquals("restheart", request.getDBName());
273273
assertEquals("acme_coll", request.getCollectionName());
274274
}

0 commit comments

Comments
 (0)