Skip to content

Commit

Permalink
Updating api/measures required parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
smoneuse committed Mar 21, 2024
1 parent 08e77f6 commit 359a0e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/bin/
/.settings/
.project
.classpath
.classpath
.idea
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public SearchProjects getProjectsOldMax500() {
}

public Component getProject(String key) {
return get("api/measures/component?metricKeys=ncloc&componentKey=" + key, getHeadersAuthorization(), Component.class, true);
return get("api/measures/component?metricKeys=ncloc&component=" + key, getHeadersAuthorization(), Component.class, true);
}

public void deleteProject(String key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void testSearchProjects() {

@Test
public void testComponentDetail() {
stubFor(get(urlEqualTo("/api/measures/component?metricKeys=ncloc&componentKey=com.company%3Aproject1"))
stubFor(get(urlEqualTo("/api/measures/component?metricKeys=ncloc&component=com.company%3Aproject1"))
.willReturn(aResponse().withHeader(HCTKEY, HCTJSON).withBodyFile("measures.component.1.json")));
SonarQubeClient client = mockClient();
Component project = client.getProject(PROJECT_KEY);
Expand All @@ -119,7 +119,7 @@ public void testComponentDetail() {

@Test
public void testComponentDetailNoLoC() {
stubFor(get(urlEqualTo("/api/measures/component?metricKeys=ncloc&componentKey=com.company%3Aproject1"))
stubFor(get(urlEqualTo("/api/measures/component?metricKeys=ncloc&component=com.company%3Aproject1"))
.willReturn(aResponse().withHeader(HCTKEY, HCTJSON).withBodyFile("measures.component.0.json")));
SonarQubeClient client = mockClient();
Component project = client.getProject(PROJECT_KEY);
Expand Down

0 comments on commit 359a0e3

Please sign in to comment.