Skip to content

Commit

Permalink
fix: improve Unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Nov 29, 2024
1 parent 9c3b566 commit ff8f706
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ void shouldStoreYearProperty() throws RmesException {
IRI operationIRI = valueFactory.createIRI("http://operation/2");
mockedFactory.when(() -> RdfUtils.setLiteralInt(anyString())).thenCallRealMethod();
mockedFactory.when(() -> RdfUtils.addTripleInt(any(), any(), any(), any(), any())).thenCallRealMethod();
mockedFactory.when(() -> RdfUtils.addTripleString(any(), any(), any(), any(), any(), any())).thenCallRealMethod();
mockedFactory.when(() -> RdfUtils.setLiteralString(anyString(), anyString())).thenCallRealMethod();
mockedFactory.when(() -> RdfUtils.setLiteralString(anyString(), anyString())).thenCallRealMethod();
mockedFactory.when(() -> RdfUtils.setLiteralString(anyString())).thenCallRealMethod();
mockedFactory.when(() -> RdfUtils.operationsGraph()).thenReturn(valueFactory.createIRI("http://operations-graph/"));
Expand All @@ -75,6 +77,8 @@ void shouldStoreYearProperty() throws RmesException {
operation
.put("prefLabelLg1", "prefLabelLg1")
.put("prefLabelLg2", "prefLabelLg2")
.put("altLabelLg1", "altLabelLg1")
.put("altLabelLg2", "altLabelLg2")
.put("year", 2024)
.put("series", series);

Expand All @@ -84,7 +88,7 @@ void shouldStoreYearProperty() throws RmesException {

verify(repositoryGestion, times(1)).loadSimpleObject(eq(operationIRI), model.capture());

Assertions.assertEquals("[(http://operation/2, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://rdf.insee.fr/def/base#StatisticalOperation, http://operations-graph/) [http://operations-graph/], (http://operation/2, http://www.w3.org/2004/02/skos/core#prefLabel, \"prefLabelLg1\"@fr, http://operations-graph/) [http://operations-graph/], (http://operation/2, http://rdf.insee.fr/def/base#validationState, \"Unpublished\", http://operations-graph/) [http://operations-graph/], (http://operation/2, http://purl.org/dc/terms/temporal, \"2024\"^^<http://www.w3.org/2001/XMLSchema#int>, http://operations-graph/) [http://operations-graph/]]", model.getValue().toString());
Assertions.assertEquals("[(http://operation/2, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://rdf.insee.fr/def/base#StatisticalOperation, http://operations-graph/) [http://operations-graph/], (http://operation/2, http://www.w3.org/2004/02/skos/core#prefLabel, \"prefLabelLg1\"@fr, http://operations-graph/) [http://operations-graph/], (http://operation/2, http://rdf.insee.fr/def/base#validationState, \"Unpublished\", http://operations-graph/) [http://operations-graph/], (http://operation/2, http://www.w3.org/2004/02/skos/core#prefLabel, \"prefLabelLg2\"@en, http://operations-graph/) [http://operations-graph/], (http://operation/2, http://www.w3.org/2004/02/skos/core#altLabel, \"altLabelLg1\"@fr, http://operations-graph/) [http://operations-graph/], (http://operation/2, http://www.w3.org/2004/02/skos/core#altLabel, \"altLabelLg2\"@en, http://operations-graph/) [http://operations-graph/], (http://operation/2, http://purl.org/dc/terms/temporal, \"2024\"^^<http://www.w3.org/2001/XMLSchema#int>, http://operations-graph/) [http://operations-graph/]]", model.getValue().toString());

}

Expand Down

0 comments on commit ff8f706

Please sign in to comment.