Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set environment variable using extensions in tests #2798

Closed
wants to merge 14 commits into from

Conversation

JoeWang1127
Copy link
Collaborator

@JoeWang1127 JoeWang1127 commented May 22, 2024

Fix: #2785

@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label May 22, 2024
private static final String DEFAULT_ENDPOINT = "test.googleapis.com:443";
private static final String DEFAULT_MTLS_ENDPOINT = "test.mtls.googleapis.com:443";
private EndpointContext.Builder defaultEndpointContextBuilder;
private StatusCode statusCode;

@SystemStub private final EnvironmentVariables environmentVariables = new EnvironmentVariables();
Copy link
Collaborator Author

@JoeWang1127 JoeWang1127 May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's no straightforward way to set environment variables in Junit 5.

I followed this post to use systemstubs.

The library is under MIT license and we're free to use. See go/licensetable.

@JoeWang1127 JoeWang1127 deleted the chore/remove-env-in-test branch May 22, 2024 22:29
Copy link

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update environment variable unit tests with Junit 5 features.
1 participant