Skip to content

Commit

Permalink
chore: refactor some test
Browse files Browse the repository at this point in the history
  • Loading branch information
nsenave committed Jul 18, 2024
1 parent d71fd20 commit 0b3321c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions eno-core/src/test/java/fr/insee/eno/core/DDIToLunaticTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

Expand Down Expand Up @@ -50,13 +51,16 @@ void transformQuestionnaire_nonNullOutput(String questionnaireId) throws DDIPars
}

@Test
void ddiWithTableWithNestedCodeListHeader_shouldThrowException() {
void ddiWithTableWithNestedCodeListHeader_shouldThrowException() throws IOException {
// Given
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(
"functional/ddi/ddi-l8x6fhtd.xml");
EnoParameters enoParameters = EnoParameters.of(Context.DEFAULT, ModeParameter.CAWI, Format.LUNATIC);
// When + Then
assertThrows(UnauthorizedHeaderException.class, () -> DDIToLunatic.transform(inputStream, enoParameters));
try (InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(
"functional/ddi/ddi-l8x6fhtd.xml")) {
EnoParameters enoParameters = EnoParameters.of(Context.DEFAULT, ModeParameter.CAWI, Format.LUNATIC);
// When + Then
assertThrows(UnauthorizedHeaderException.class, () -> DDIToLunatic.transform(inputStream, enoParameters));
} catch (IOException e) {
throw new IOException("IOException occurred with test DDI file 'l8x6fhtd'.");
}
}

@Test
Expand Down

0 comments on commit 0b3321c

Please sign in to comment.