These instructions assume you are using vscode for development as SDK is configured for it.
- Clone this repo and open the java folder in vscode.
- Install the recommended extension pack "Extension Pack for Java"
- The extension will prompt you to install a JDK. Choose JDK version 11 (LTS).
- Download and install Maven.
- Once you have the extension and JDK installed, run mvn test (see next section for test setup).
- Get a user token using the CLI command: user show --verbose
- Create a new environment variable TEST_TUNNEL_TOKEN with a string value "Bearer ".
- Create a new environment variable TEST_TUNNEL_NAME with a value containing the name of the tunnel.
- Optionally: set TEST_TUNNEL_VERBOSE=1 to enable verbose console logging during tests.
- Use the CLI to host the tunnel.
- Run the tests with mvn test, or run a single test with mvn test -Dtest=TunnelClientTests#connectClient
The Tunnels Java SDK is published as a GitHub package through a GitHub Action. Since the repo is shared by multiple language SDKs, the Java packages are distinguished with a tag of the form java-vX.Y.Z. See tags for examples.
Follow these steps to publish a new version of the Java package:
- Create a new release.
- Create a new tag in the java-vX.Y.Z format. The version needs to be greater than the latest java-* version in the releases page.
- Set the release title the same as the version tag. Increment the major, minor, or patch version from the latest release as appropriate.
- Publish the release.