-
Notifications
You must be signed in to change notification settings - Fork 15
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
Enforce java 11 due to openapi generator compatibility #74
Merged
maczikasz
merged 8 commits into
dependabot/gradle/org.openapi.generator-7.0.0
from
maczikasz/dependabot/gradle/org.openapi.generator-7.0.0
Sep 7, 2023
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f845ed0
Enforce java 11 due to openapi generator compatibility https://github…
maczikasz 5ff2b20
Add test to verify java 8 compatibility
maczikasz 5523688
Rename test
maczikasz d17db04
Add info to readme
maczikasz 6fc4179
Update build.gradle.kts
maczikasz 06d4a78
Use proper assertion
maczikasz 73cf4b7
Update README.md
maczikasz 9957e57
Use provider API and toolchain
maczikasz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/test/java/com/gradle/enterprise/api/SimpleApiClientTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.gradle.enterprise.api; | ||
|
||
import com.gradle.enterprise.api.client.ApiClient; | ||
import com.gradle.enterprise.api.client.ApiException; | ||
import com.gradle.enterprise.api.client.ServerConfiguration; | ||
import com.gradle.enterprise.api.model.Build; | ||
import com.gradle.enterprise.api.model.BuildsQuery; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.mockserver.configuration.Configuration; | ||
import org.mockserver.integration.ClientAndServer; | ||
import org.mockserver.logging.MockServerLogger; | ||
import org.mockserver.mock.Expectation; | ||
import org.mockserver.openapi.OpenAPIConverter; | ||
|
||
import java.net.InetSocketAddress; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
|
||
public class SimpleApiClientTest { | ||
|
||
private static final String gradleEnterpriseAPIYamlUrl = System.getProperty("ge.api.url"); | ||
|
||
private ClientAndServer mockServer; | ||
|
||
@BeforeEach | ||
public void setup() { | ||
Configuration configuration = Configuration.configuration(); | ||
List<Expectation> openApiExpectations = new OpenAPIConverter(new MockServerLogger()).buildExpectations(gradleEnterpriseAPIYamlUrl, null); | ||
mockServer = ClientAndServer.startClientAndServer(configuration, Collections.singletonList(19234)); | ||
mockServer.upsert(openApiExpectations.toArray(new Expectation[0])); | ||
} | ||
|
||
@Test | ||
public void testSimpleAPICall() throws ApiException { | ||
InetSocketAddress remoteAddress = mockServer.remoteAddress(); | ||
|
||
ApiClient apiClient = new ApiClient(); | ||
apiClient.setServers(Collections.singletonList(new ServerConfiguration( | ||
"http://" + remoteAddress.getHostName() + ":" + remoteAddress.getPort(), "mockServer", Collections.emptyMap() | ||
))); | ||
BuildsApi buildsApi = new BuildsApi(apiClient); | ||
apiClient.addDefaultHeader("Authorization", "Bearer XYZ"); | ||
|
||
List<Build> builds = buildsApi.getBuilds(new BuildsQuery()); | ||
|
||
assertFalse(builds.isEmpty()); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comma before 'JDK 11'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be 'JDK 8'? Also, that sentence is missing a period.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's not JDK 8, because running an app does not need a JDK but a JRE, but using JRE would've been kindof weird IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should capitalize 'Java'.