Skip to content

Commit

Permalink
Added unit tests for execution/deployment counts
Browse files Browse the repository at this point in the history
  • Loading branch information
Roshin Rajan Panackal committed Sep 16, 2024
1 parent cf8458f commit 46298ac
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,25 @@ void patchDeploymentConfiguration() {
}
""")));
}

@Test
void getDeploymentCount() {
wireMockServer.stubFor(
get(urlPathEqualTo("/lm/deployments/$count"))
.withHeader("AI-Resource-Group", equalTo("default"))
.willReturn(
aResponse()
.withStatus(HttpStatus.SC_OK)
.withHeader("content-type", "application/json")
.withBody(
"""
1
""")));

final int count = new DeploymentApi(getClient(destination)).deploymentCount("default");

assertThat(count).isEqualTo(1);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,23 @@ void patchExecution() {
.withHeader("AI-Resource-Group", equalTo("default"))
.withRequestBody(equalToJson("{\"targetStatus\":\"STOPPED\"}")));
}

@Test
void getExecutionCount() {
wireMockServer.stubFor(
get(urlPathEqualTo("/lm/executions/$count"))
.withHeader("AI-Resource-Group", equalTo("default"))
.willReturn(
aResponse()
.withStatus(HttpStatus.SC_OK)
.withHeader("content-type", "application/json")
.withBody(
"""
1
""")));

final int count = new ExecutionApi(getClient(destination)).executionCount("default");

assertThat(count).isEqualTo(1);
}
}

0 comments on commit 46298ac

Please sign in to comment.