Skip to content

Commit

Permalink
fix(irs-api):[eclipse-tractusx#538] fix code-smells
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-jhartmann committed Jul 10, 2024
1 parent 8f918af commit dbc501a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ void shouldCreateDetailedTombstoneForMissmatchPolicy() {
final Jobs jobForJobId = irsService.getJobForJobId(jobHandle.getId(), false);

assertThat(jobForJobId.getJob().getState()).isEqualTo(JobState.COMPLETED);
assertThat(jobForJobId.getShells()).hasSize(0);
assertThat(jobForJobId.getRelationships()).hasSize(0);
assertThat(jobForJobId.getSubmodels()).hasSize(0);
assertThat(jobForJobId.getShells()).isEmpty();
assertThat(jobForJobId.getRelationships()).isEmpty();
assertThat(jobForJobId.getSubmodels()).isEmpty();
assertThat(jobForJobId.getTombstones()).hasSize(1);
final Tombstone actualTombstone = jobForJobId.getTombstones().get(0);
assertThat(actualTombstone.getProcessingError().getRootCauses()).hasSize(1);
Expand Down Expand Up @@ -331,9 +331,9 @@ void shouldCreateDetailedTombstoneForEdcErrors() {
final Jobs jobForJobId = irsService.getJobForJobId(jobHandle.getId(), false);

assertThat(jobForJobId.getJob().getState()).isEqualTo(JobState.COMPLETED);
assertThat(jobForJobId.getShells()).hasSize(0);
assertThat(jobForJobId.getRelationships()).hasSize(0);
assertThat(jobForJobId.getSubmodels()).hasSize(0);
assertThat(jobForJobId.getShells()).isEmpty();
assertThat(jobForJobId.getRelationships()).isEmpty();
assertThat(jobForJobId.getSubmodels()).isEmpty();
assertThat(jobForJobId.getTombstones()).hasSize(1);
final Tombstone actualTombstone = jobForJobId.getTombstones().get(0);
assertThat(actualTombstone.getProcessingError().getRootCauses()).hasSize(1);
Expand Down Expand Up @@ -363,9 +363,9 @@ void shouldCreateDetailedTombstoneForDiscoveryErrors() {
final Jobs jobForJobId = irsService.getJobForJobId(jobHandle.getId(), false);

assertThat(jobForJobId.getJob().getState()).isEqualTo(JobState.COMPLETED);
assertThat(jobForJobId.getShells()).hasSize(0);
assertThat(jobForJobId.getRelationships()).hasSize(0);
assertThat(jobForJobId.getSubmodels()).hasSize(0);
assertThat(jobForJobId.getShells()).isEmpty();
assertThat(jobForJobId.getRelationships()).isEmpty();
assertThat(jobForJobId.getSubmodels()).isEmpty();
assertThat(jobForJobId.getTombstones()).hasSize(1);
final Tombstone actualTombstone = jobForJobId.getTombstones().get(0);
assertThat(actualTombstone.getProcessingError().getRootCauses()).hasSize(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,6 @@ public List<CompletableFuture<EndpointDataReference>> getEndpointReferencesForAs

final String storageId = getStorageId(endpointDataReferenceStatus, negotiationResponse);

// TODO (#538) Remove this comment and code later.
// This is just for quickly simulating and experimenting with negotiation
// failed during development.
// It should later be replaced with a real automated test in
// IrsWireMockIntegrationTest that simulates this
// (this test could probably be based on shouldStartRecursiveProcesses
// but needs different setup throwing an exception during negotiation).
// if (true) {
// throw new EdcClientException("negotiation failed");
// }
return pollingService.<EndpointDataReference>createJob()
.action(() -> retrieveEndpointReference(storageId, stopWatch))
.timeToLive(config.getSubmodel().getRequestTtl())
Expand Down

0 comments on commit dbc501a

Please sign in to comment.