- @Test
- public void incorrectTopLevelElementTest() {
-
- CompositeNode compositeNode = TestUtils.readInputToCnSn("/cnsn-to-json/simple-data-types/xml/data.xml", XmlToCompositeNodeProvider.INSTANCE);
- DataSchemaNode incorrectDataSchema = null;
- incorrectDataSchema = new IncorrectDataSchema();
-
- TestUtils.normalizeCompositeNode(compositeNode, modules, "simple-data-types:cont");
-
- boolean exceptionRaised = false;
- try {
- TestUtils.writeCompNodeWithSchemaContextToOutput(compositeNode, modules, incorrectDataSchema,
- StructuredDataToJsonProvider.INSTANCE);
- } catch (UnsupportedDataTypeException e) {
- exceptionRaised = true;
- } catch (WebApplicationException | IOException e) {
- LOG.error("WebApplicationException or IOException was raised");
- }
-
- assertTrue(exceptionRaised);
- }
-