APISonar


org.elasticsearch.xpack.core.ml.filestructurefinder.FileStructure.Format.XML

> org > elasticsearch > xpack > core > ml > filestructurefinder > FileStructure > Format > XML
org APIs elasticsearch APIs xpack APIs core APIs ml APIs filestructurefinder APIs FileStructure APIs Format APIs XML APIs

Example 1
public void testValidateNonSemiStructuredText() {

        FindFileStructureAction.Request request = new FindFileStructureAction.Request();
        request.setFormat(randomFrom(FileStructure.Format.NDJSON, FileStructure.Format.XML, FileStructure.Format.DELIMITED));
        request.setGrokPattern(randomAlphaOfLength(80));
        request.setSample(new BytesArray("foo\n"));

        ActionRequestValidationException e = request.validate();
        assertNotNull(e);
        assertThat(e.getMessage(), startsWith("Validation Failed: "));
        assertThat(e.getMessage(), containsString(" [grok_pattern] may only be specified if [format] is [semi_structured_text]"));
    }