Skip to content

Commit

Permalink
fix(suggester): add meloto property (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsenave authored Mar 7, 2024
1 parent f9dc401 commit 9b3d4e7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>fr.insee.pogues</groupId>
<artifactId>pogues-model</artifactId>
<packaging>jar</packaging>
<version>1.3.2</version>
<version>1.3.3</version>
<name>Pogues Model</name>
<description>Classes and converters for the Pogues model</description>
<url>https://inseefr.github.io/Pogues-Model/</url>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/xsd/Questionnaire.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="fields" type="SuggesterField" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="meloto" type="xs:boolean" minOccurs="0"/>
<xs:element name="max" type="xs:integer" minOccurs="0"/>
<xs:element name="stopWords" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="order" type="SuggesterOrder" minOccurs="0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class SuggesterParametersTypeTest {
"CodeList": [
{
"SuggesterParameters": {
"meloto": true,
"url": "some url",
"version": 1
}
Expand All @@ -42,6 +43,7 @@ void serializeJsonSuggesters() throws JAXBException, UnsupportedEncodingExceptio
//
CodeList codeList = new CodeList();
SuggesterParametersType suggesterParametersType = new SuggesterParametersType();
suggesterParametersType.setMeloto(true);
suggesterParametersType.setUrl("some url");
suggesterParametersType.setVersion(BigInteger.ONE);
codeList.setSuggesterParameters(suggesterParametersType);
Expand All @@ -68,6 +70,7 @@ void deserializeJsonSuggesters() throws JAXBException {
new ByteArrayInputStream(jsonSuggesters.getBytes()));
//
SuggesterParametersType suggesterParameters = questionnaire.getCodeLists().getCodeList().getFirst().getSuggesterParameters();
assertEquals(true, suggesterParameters.isMeloto());
assertEquals("some url", suggesterParameters.getUrl());
assertEquals(BigInteger.ONE, suggesterParameters.getVersion());
}
Expand All @@ -83,6 +86,7 @@ void suggestersJsonToXml() throws JAXBException {
<CodeLists>
<CodeList>
<SuggesterParameters>
<meloto>true</meloto>
<url>some url</url>
<version>1</version>
</SuggesterParameters>
Expand Down

0 comments on commit 9b3d4e7

Please sign in to comment.