Skip to content

Commit

Permalink
feat: add unit test (#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey authored Dec 3, 2024
1 parent cc3f75e commit cd01bd4
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

Expand All @@ -35,9 +36,17 @@ void should_return_all_operations() throws Exception {
}

@Test
void should_return_one_operation() throws Exception {
void should_return_operation() throws Exception {
OpSeriesQueries.setConfig(new ConfigStub());

JSONObject result = repositoryGestion.getResponseAsObject(OperationsQueries.operationQuery("s1447"));
assertThat(result.getString("id")).hasToString("s1447");
assertThat(result.getString("prefLabelLg1")).hasToString("Dispositif d'enquêtes permanentes des conditions de vie 2008");
assertThat(result.getString("prefLabelLg2")).hasToString("Permanent living conditions survey 2008");
assertThat(result.getString("altLabelLg2")).hasToString("EPCV scheme 2008");
assertThat(result.getString("altLabelLg1")).hasToString("EPCV 2008");
assertThat(result.getString("validationState")).hasToString("Validated");
assertEquals("2024", result.getString("year"));

}
}

0 comments on commit cd01bd4

Please sign in to comment.