Add support for testing with WireMock
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the DbxClientV2 constructors and DbxRequestUtil.buildUri, using the reported stack trace to trace how a custom host and port are handled. Done should allow a client configured for a localhost WireMock endpoint to construct valid request URIs and run Dropbox interaction tests without shared user credentials.
Written by the indexing model from the issue text.
Description
Hi,
We have some tests that verify our application can connect and interact with DropBox. Ideally, we'd like to be able to run these tests as part of our CI builds without requiring user credentials to be set up and shared.
I tried to use WireMock to capture real data for use in the mocked interactions, but ran into a couple of issues:
- Although there is a public constructor on DbxClientV2 that accepts a DbxHost object with custom URLs, there wasn't one with the correct combination of parameters that we needed. Our application uses the
DbxClientV2(DbxRequestConfig, DbxCredential), so I'd have liked to append theDbxHostargument to that. Or failing that, call the private all-args constructor, which is essentially what I ended up doing via reflection. - Even with a client configured to use a WireMock endpoint at
localhost:{randomPort}, I got aURISyntaxExceptionwhen trying to connect:
java.lang.RuntimeException: URI creation failed, host="localhost:38343", path="2/files/get_metadata": Malformed IPv6 address at index 9: https://[localhost:38343]/2/files/get_metadata
at com.dropbox.core.util.LangUtil.mkAssert(LangUtil.java:15)
at com.dropbox.core.DbxRequestUtil.buildUri(DbxRequestUtil.java:73)
at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:269)
at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:146)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:330)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriableWithRefresh(DbxRawClientV2.java:351)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:137)
at com.dropbox.core.v2.files.DbxUserFilesRequests.getMetadata(DbxUserFilesRequests.java:1571)
at com.dropbox.core.v2.files.DbxUserFilesRequests.getMetadata(DbxUserFilesRequests.java:1603)
Are there any plans to make the host and port configurable?
- Dominant language
- Java
- Stars
- 627
- Forks
- 463
- Avg merge
- 5m
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dropbox/dropbox-sdk-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dropbox/dropbox-sdk-java#536 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
dropbox/dropbox-sdk-java#560 · 6 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
dropbox/dropbox-sdk-java#550 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
dropbox/dropbox-sdk-java#542 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
dropbox/dropbox-sdk-java#535 · 1 comment ·
All issues in dropbox/dropbox-sdk-java
Similar issues
-
certification
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Openbug ecr
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Needs: Triage Type: Feature request
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/copilot-sdk#2760 ·