Skip to content

Commit

Permalink
tests ok
Browse files Browse the repository at this point in the history
  • Loading branch information
zub4t committed Jul 2, 2024
1 parent a022b3e commit 4811ad4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void shouldCallTransferProcessApiWithFailed(TransferProcessStore store, DataPlan
var transferProcess = store.findById("tp-id");
assertThat(transferProcess).isNotNull().satisfies(process -> {
assertThat(process.getState()).isGreaterThanOrEqualTo(TERMINATED.code());
assertThat(process.getErrorDetail()).isEqualTo(GENERAL_ERROR + "error");
assertThat(process.getErrorDetail()).isEqualTo(GENERAL_ERROR + ": error");
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import static java.util.concurrent.CompletableFuture.completedFuture;
import static java.util.concurrent.CompletableFuture.failedFuture;
import static org.assertj.core.api.Assertions.assertThat;
import static org.eclipse.edc.connector.dataplane.spi.pipeline.StreamFailure.Reason.GENERAL_ERROR;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.mockito.ArgumentMatchers.any;
Expand Down Expand Up @@ -116,7 +117,7 @@ void should_returnInternalServerError_if_transferFails() {
.then()
.statusCode(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())
.contentType(JSON)
.body("errors[0]", is(errorMsg));
.body("errors[0]", is(GENERAL_ERROR + ": " +errorMsg));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void should_returnForbidden_if_tokenValidationFails() {
@Test
void should_returnInternalServerError_if_transferFails() {
var token = UUID.randomUUID().toString();
var errorMsg = GENERAL_ERROR + ": " + UUID.randomUUID().toString();
var errorMsg = UUID.randomUUID().toString();
when(dataAddressResolver.resolve(any())).thenReturn(Result.success(testDestAddress()));
when(pipelineService.transfer(any(), any()))
.thenReturn(completedFuture(StreamResult.error(errorMsg)));
Expand All @@ -105,7 +105,7 @@ void should_returnInternalServerError_if_transferFails() {
.then()
.statusCode(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())
.contentType(JSON)
.body("errors[0]", is(errorMsg));
.body("errors[0]", is(GENERAL_ERROR + ": " + errorMsg));
}

@Test
Expand Down

0 comments on commit 4811ad4

Please sign in to comment.