Skip to content

Commit

Permalink
Use /api/v1/event/token/{uuid} instead of /api/v1/bom/token/{uui} i…
Browse files Browse the repository at this point in the history
…n e2e tests (#1528)
  • Loading branch information
nscuro authored Sep 19, 2024
1 parent 6a82e10 commit 39bea7f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Hyades

[![Build Status](https://github.com/DependencyTrack/hyades/actions/workflows/ci.yml/badge.svg)](https://github.com/DependencyTrack/hyades/actions/workflows/ci.yml)
[![End-to-End Test](https://github.com/DependencyTrack/hyades/actions/workflows/e2e-test.yml/badge.svg)](https://github.com/DependencyTrack/hyades/actions/workflows/e2e-test.yml)
[![Codacy Code Quality Badge](https://app.codacy.com/project/badge/Grade/64c349c2b92340ffb83f7dba1d6b03e5)](https://app.codacy.com/gh/DependencyTrack/hyades/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Codacy Coverage Badge](https://app.codacy.com/project/badge/Coverage/64c349c2b92340ffb83f7dba1d6b03e5)](https://app.codacy.com/gh/DependencyTrack/hyades/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)

Expand Down
14 changes: 9 additions & 5 deletions docs/getting-started/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ Refer to the [kafka configuration reference] for details. Example of name change
|:-----------------------------------------------------------|:----------------------------------------------------|
| `alpine.kafka.processor.vuln.scan.result.processing.order` | `kafka.processor.vuln.scan.result.processing.order` |

* All deprecated endpoints mentioned below were removed:
* POST `/api/v1/policy/{policyUuid}/tag/{tagName}`
* DELETE `/api/v1/policy/{policyUuid}/tag/{tagName}`
* GET `/api/v1/tag/{policyUuid}`
* GET `/api/v1/bom/token/{uuid}`
* The endpoints deprecated in v4.x mentioned below were removed ([apiserver/#910]):

| Removed endpoint | Replacement |
|:---------------------------------------------------|:-----------------------------------|
| `POST /api/v1/policy/{policyUuid}/tag/{tagName}` | `POST /api/v1/tag/{name}/policy` |
| `DELETE /api/v1/policy/{policyUuid}/tag/{tagName}` | `DELETE /api/v1/tag/{name}/policy` |
| `GET /api/v1/tag/{policyUuid}` | `GET /api/v1/tag/policy/{uuid}` |
| `GET /api/v1/bom/token/{uuid}` | `GET /api/v1/event/token/{uuid}` |

[apiserver/#840]: https://github.com/DependencyTrack/hyades-apiserver/pull/840
[apiserver/#888]: https://github.com/DependencyTrack/hyades-apiserver/pull/888
[apiserver/#904]: https://github.com/DependencyTrack/hyades-apiserver/pull/904
[apiserver/#910]: https://github.com/DependencyTrack/hyades-apiserver/pull/910
[hyades/#1392]: https://github.com/DependencyTrack/hyades/issues/1392

[kafka configuration reference]: ../reference/configuration/api-server.md#kafka
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import jakarta.ws.rs.core.MediaType;
import org.dependencytrack.apiserver.model.Analysis;
import org.dependencytrack.apiserver.model.ApiKey;
import org.dependencytrack.apiserver.model.BomProcessingResponse;
import org.dependencytrack.apiserver.model.EventProcessingResponse;
import org.dependencytrack.apiserver.model.BomUploadRequest;
import org.dependencytrack.apiserver.model.ConfigProperty;
import org.dependencytrack.apiserver.model.CreateNotificationRuleRequest;
Expand Down Expand Up @@ -95,10 +95,10 @@ Team addPermissionToTeam(@PathParam("uuid") final UUID teamUuid,
WorkflowTokenResponse uploadBom(final BomUploadRequest request);

@GET
@Path("/bom/token/{token}")
@Path("/event/token/{token}")
@Produces(MediaType.WILDCARD)
@Consumes(MediaType.WILDCARD)
BomProcessingResponse isBomBeingProcessed(@PathParam("token") final String token);
EventProcessingResponse isEventBeingProcessed(@PathParam("token") final String token);

@PUT
@Path("/vulnerability")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public record BomProcessingResponse(Boolean processing) {
public record EventProcessingResponse(Boolean processing) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.dependencytrack.e2e;

import org.dependencytrack.apiserver.model.BomProcessingResponse;
import org.dependencytrack.apiserver.model.EventProcessingResponse;
import org.dependencytrack.apiserver.model.BomUploadRequest;
import org.dependencytrack.apiserver.model.Finding;
import org.dependencytrack.apiserver.model.Project;
Expand Down Expand Up @@ -68,7 +68,7 @@ void test() throws Exception {
.atMost(Duration.ofSeconds(30))
.pollDelay(Duration.ofMillis(250))
.untilAsserted(() -> {
final BomProcessingResponse processingResponse = apiServerClient.isBomBeingProcessed(response.token());
final EventProcessingResponse processingResponse = apiServerClient.isEventBeingProcessed(response.token());
assertThat(processingResponse.processing()).isFalse();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
import com.icegreen.greenmail.junit5.GreenMailExtension;
import com.icegreen.greenmail.util.ServerSetup;
import org.dependencytrack.apiserver.model.BomProcessingResponse;
import org.dependencytrack.apiserver.model.EventProcessingResponse;
import org.dependencytrack.apiserver.model.BomUploadRequest;
import org.dependencytrack.apiserver.model.ConfigProperty;
import org.dependencytrack.apiserver.model.CreateNotificationRuleRequest;
Expand Down Expand Up @@ -166,7 +166,7 @@ void test() throws Exception {
.atMost(Duration.ofSeconds(15))
.pollDelay(Duration.ofMillis(250))
.untilAsserted(() -> {
final BomProcessingResponse processingResponse = apiServerClient.isBomBeingProcessed(response.token());
final EventProcessingResponse processingResponse = apiServerClient.isEventBeingProcessed(response.token());
assertThat(processingResponse.processing()).isFalse();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.dependencytrack.e2e;

import org.dependencytrack.apiserver.model.BomProcessingResponse;
import org.dependencytrack.apiserver.model.EventProcessingResponse;
import org.dependencytrack.apiserver.model.BomUploadRequest;
import org.dependencytrack.apiserver.model.Finding;
import org.dependencytrack.apiserver.model.Project;
Expand Down Expand Up @@ -81,7 +81,7 @@ void test() throws Exception {
.atMost(Duration.ofSeconds(30))
.pollDelay(Duration.ofMillis(250))
.untilAsserted(() -> {
final BomProcessingResponse processingResponse = apiServerClient.isBomBeingProcessed(response.token());
final EventProcessingResponse processingResponse = apiServerClient.isEventBeingProcessed(response.token());
assertThat(processingResponse.processing()).isFalse();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.dependencytrack.apiserver.model.Analysis;
import org.dependencytrack.apiserver.model.BomProcessingResponse;
import org.dependencytrack.apiserver.model.EventProcessingResponse;
import org.dependencytrack.apiserver.model.BomUploadRequest;
import org.dependencytrack.apiserver.model.CreateNotificationRuleRequest;
import org.dependencytrack.apiserver.model.CreateVulnerabilityRequest;
Expand Down Expand Up @@ -219,7 +219,7 @@ void test() throws Exception {
.atMost(Duration.ofSeconds(15))
.pollDelay(Duration.ofMillis(250))
.untilAsserted(() -> {
final BomProcessingResponse processingResponse = apiServerClient.isBomBeingProcessed(response.token());
final EventProcessingResponse processingResponse = apiServerClient.isEventBeingProcessed(response.token());
assertThat(processingResponse.processing()).isFalse();
});

Expand Down

0 comments on commit 39bea7f

Please sign in to comment.