@Test public void testWrongImportBaseModel__DefinitionsInput() throws IOException { final List<DMNMessage> messages = validator.validateUsing(Validation.VALIDATE_MODEL) .theseModels(getDefinitions(Arrays.asList("import/Base-model.dmn", "import/Wrong-Import-base-model.dmn"), "http://www.trisotech.com/definitions/_70df1ad5-2a33-4ede-b8b2-869988ac1d30", "Base model"), getDefinitions(Arrays.asList("import/Base-model.dmn", "import/Wrong-Import-base-model.dmn"), "http://www.trisotech.com/dmn/definitions/_719a2325-5cac-47ea-8a99-665c01d570a5", "Wrong Import base model")); assertTrue(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.REQ_NOT_FOUND) && p.getSourceReference() instanceof DMNElementReference && ((DMNElementReference) p.getSourceReference()).getHref() .equals("http://www.trisotech.com/definitions/_70df1ad5-2a33-4ede-b8b2-869988ac1d30#_1d52934e-aa4e-47c9-a011-fc989d795664"))); }
@Test public void testWrongImportBaseModel__FileInput() throws IOException { final List<DMNMessage> messages = validator.validateUsing(Validation.VALIDATE_MODEL) .theseModels(getFile("import/Base-model.dmn"), getFile("import/Wrong-Import-base-model.dmn")); assertThat(ValidatorUtil.formatMessages(messages), messages.size(), is(1)); assertTrue(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.REQ_NOT_FOUND) && p.getSourceReference() instanceof DMNElementReference && ((DMNElementReference) p.getSourceReference()).getHref() .equals("http://www.trisotech.com/definitions/_70df1ad5-2a33-4ede-b8b2-869988ac1d30#_1d52934e-aa4e-47c9-a011-fc989d795664"))); }
@Test public void testWrongImportBaseModel__ReaderInput() throws IOException { try (final Reader reader0 = getReader("import/Base-model.dmn"); final Reader reader1 = getReader("import/Wrong-Import-base-model.dmn");) { final List<DMNMessage> messages = validator.validateUsing(Validation.VALIDATE_MODEL) .theseModels(reader0, reader1); assertThat(ValidatorUtil.formatMessages(messages), messages.size(), is(1)); assertTrue(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.REQ_NOT_FOUND) && p.getSourceReference() instanceof DMNElementReference && ((DMNElementReference) p.getSourceReference()).getHref() .equals("http://www.trisotech.com/definitions/_70df1ad5-2a33-4ede-b8b2-869988ac1d30#_1d52934e-aa4e-47c9-a011-fc989d795664"))); } }