Skip to content

Commit

Permalink
style(format): mvn formatter:format (refs #351)
Browse files Browse the repository at this point in the history
  • Loading branch information
mborne committed Aug 8, 2024
1 parent 45d145e commit 5bbfd1a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ private ModelReaderFactory() {
*/
public static ModelReader createModelReader(URL url) {
if (url.toString().endsWith(".xml")) {
throw new InvalidModelException("Fail to load "+url+" (XML model support has been removed, use JSON format)");
throw new InvalidModelException(
"Fail to load " + url + " (XML model support has been removed, use JSON format)"
);
} else {
return new JsonModelReader();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
* Prototype based factory providing AttributeType creation by name (Boolean,
* Double, etc.)
*
* @see src/main/resources/META-INF/services/fr.ign.validator.model.AttributeType containing the list of this types.
* @see src/main/resources/META-INF/services/fr.ign.validator.model.AttributeType
* containing the list of this types.
*
* @author MBorne
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ public void testXml() throws MalformedURLException {
RuntimeException thrown = null;
try {
ModelReaderFactory.createModelReader(url);
}catch(RuntimeException e){
} catch (RuntimeException e) {
thrown = e;
}
assertNotNull(thrown);
assertTrue(thrown instanceof InvalidModelException);
assertEquals("Fail to load https://example.org/my-model.xml (XML model support has been removed, use JSON format)",thrown.getMessage());
assertEquals(
"Fail to load https://example.org/my-model.xml (XML model support has been removed, use JSON format)",
thrown.getMessage()
);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ public void testDocumentNotOk() throws Exception {
.getMessage()
);


Assert.assertEquals(5, report.getErrorsByCode(CoreErrorCodes.ATTRIBUTE_REFERENCE_NOT_FOUND).size());
{
List<ValidatorError> errors = report.getErrorsByCode(CoreErrorCodes.ATTRIBUTE_REFERENCE_NOT_FOUND);
Expand Down

0 comments on commit 5bbfd1a

Please sign in to comment.