Skip to content

Commit

Permalink
Adding version number to API (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
craigatk authored Mar 29, 2024
1 parent 1e4b3e0 commit 67b01fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fun Route.api(
organizationCoverageService: OrganizationCoverageService,
repositoryCoverageService: RepositoryCoverageService,
) {
get("/api/org/{orgName}/coverage/current") {
get("/api/v1/org/{orgName}/coverage/current") {
val orgName = call.parameters.getOrFail("orgName")

val organizationCoverage = organizationCoverageService.getCoverage(orgName)
Expand All @@ -25,7 +25,7 @@ fun Route.api(
}
}

get("/api/repo/{orgPart}/{repoPart}/coverage/current") {
get("/api/v1/repo/{orgPart}/{repoPart}/coverage/current") {
val orgPart = call.parameters.getOrFail("orgPart")
val repoPart = call.parameters.getOrFail("repoPart")
val fullRepoName = "$orgPart/$repoPart"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ApiOrganizationApplicationTestCase : ApplicationTestCase() {
val anotherRepo = "another-org/repo"

withTestApplication(::createTestApplication) {
handleRequest(HttpMethod.Get, "/api/org/$orgName/coverage/current") {
handleRequest(HttpMethod.Get, "/api/v1/org/$orgName/coverage/current") {

testRunDBGenerator.createTestRunWithCoverageAndGitMetadata(
publicId = olderRunRepo1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ApiRepositoryApplicationTestCase : ApplicationTestCase() {
val runInDifferentRepoPublicId = randomPublicId()

withTestApplication(::createTestApplication) {
handleRequest(HttpMethod.Get, "/api/repo/$repoName/coverage/current") {
handleRequest(HttpMethod.Get, "/api/v1/repo/$repoName/coverage/current") {

testRunDBGenerator.createTestRunWithCoverageAndGitMetadata(
publicId = firstRunPublicId,
Expand Down Expand Up @@ -95,7 +95,7 @@ class ApiRepositoryApplicationTestCase : ApplicationTestCase() {
val runInDifferentRepoPublicId = randomPublicId()

withTestApplication(::createTestApplication) {
handleRequest(HttpMethod.Get, "/api/repo/$repoName/coverage/current?project=other-project") {
handleRequest(HttpMethod.Get, "/api/v1/repo/$repoName/coverage/current?project=other-project") {

testRunDBGenerator.createTestRunWithCoverageAndGitMetadata(
publicId = firstRunPublicId,
Expand Down Expand Up @@ -163,7 +163,7 @@ class ApiRepositoryApplicationTestCase : ApplicationTestCase() {
val runInDifferentRepoPublicId = randomPublicId()

withTestApplication(::createTestApplication) {
handleRequest(HttpMethod.Get, "/api/repo/$repoName/coverage/current?branch=my-branch") {
handleRequest(HttpMethod.Get, "/api/v1/repo/$repoName/coverage/current?branch=my-branch") {

testRunDBGenerator.createTestRunWithCoverageAndGitMetadata(
publicId = firstRunPublicId,
Expand Down

0 comments on commit 67b01fa

Please sign in to comment.