Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Nov 28, 2024
1 parent 406ca97 commit 0a846db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.eclipse.rdf4j.model.Resource;
import org.eclipse.rdf4j.model.Statement;
import org.eclipse.rdf4j.model.impl.LinkedHashModel;

import org.eclipse.rdf4j.repository.RepositoryConnection;
import org.eclipse.rdf4j.repository.RepositoryResult;
import org.json.JSONArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.when;
Expand All @@ -33,9 +34,10 @@ void shouldThrowExceptionIfParentSeriesIsUnpublished() throws RmesException {
operation.put("series", series);

when(ownerUtils.getValidationStatus("2")).thenReturn(ValidationStatus.UNPUBLISHED.toString());
assertThrows(
var exception = assertThrows(
RmesBadRequestException.class,
() -> operationPublication.publishOperation("1", operation)
);
assertThat(exception.getDetails()).contains("This operation cannot be published before its series is published");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.when;

Expand All @@ -32,9 +33,10 @@ void shouldThrowExceptionIfParentFamilyIsUnpublished() throws RmesException {
series.put("family", family);

when(ownerUtils.getValidationStatus("2")).thenReturn(ValidationStatus.UNPUBLISHED.toString());
assertThrows(
var exception = assertThrows(
RmesBadRequestException.class,
() -> seriesPublication.publishSeries("1", series)
);
assertThat(exception.getDetails()).contains("This Series cannot be published before its family is published");
}
}

0 comments on commit 0a846db

Please sign in to comment.