@Test
    void testInvalidElement() {
        assertThatThrownBy(() -> {
            final String inputPath = INPUT_DIR + "input06_invalidElement.xml";

            final ByteArrayInputStream input = new ByteArrayInputStream(getString(inputPath).getBytes());

            final StatisticStoreStore statisticStoreStore = getStore();
            final DocRef docRef = statisticStoreStore.createDocument(STAT_NAME);
            final StatisticStoreDoc statisticsDataSource = statisticStoreStore.readDocument(docRef);
            // xml has a value element so set this to count
            statisticsDataSource.setStatisticType(StatisticType.COUNT);
            statisticsDataSource.setConfig(new StatisticsDataSourceData(
                    Arrays.asList(new StatisticField("tag1name"), new StatisticField("tag2name"))));
            statisticsDataSource.setEnabled(true);
            statisticStoreStore.writeDocument(statisticsDataSource);

            final ErrorReceiverProxy errorReceiverProxy = new ErrorReceiverProxy(new FatalErrorReceiver());

            final StatisticsFilter statisticsFilter = new StatisticsFilter(errorReceiverProxy,
                    new LocationFactoryProxy(), this, statisticStoreStore);

            statisticsFilter.setStatisticsDataSource(docRef);

            // will throw an error as the type in the xml doesn't match the type in
            // the SDS
            ProcessorUtil.processXml(input, errorReceiverProxy, statisticsFilter, new LocationFactoryProxy());
        }).isInstanceOf(ProcessException.class);
    }
Unit test class for <code>XMLTransformer</code>.
stroom-statistics/stroom-statistics-impl-sql/src/test/java/stroom/statistics/impl/sql/filter/TestStatisticsFilter.java