Fixes test to support BytesSizeValue changes (elastic/x-pack-elasticsearch#3321)

Original commit: elastic/x-pack-elasticsearch@0bc8b0e847
This commit is contained in:
Colin Goodheart-Smithe 2017-12-14 12:17:25 +00:00 committed by GitHub
parent d24921ea60
commit 51b80aa998

View File

@ -69,7 +69,7 @@ public class AnalysisLimitsTests extends AbstractSerializingTestCase<AnalysisLim
String json = "{\"model_memory_limit\":\"-4MB\"}";
XContentParser parser = XContentFactory.xContent(XContentType.JSON).createParser(NamedXContentRegistry.EMPTY, json);
ParsingException e = expectThrows(ParsingException.class, () -> AnalysisLimits.CONFIG_PARSER.apply(parser, null));
assertThat(e.getRootCause().getMessage(), containsString("model_memory_limit must be at least 1 MiB. Value = -4"));
assertThat(e.getRootCause().getMessage(), containsString("Values less than -1 bytes are not supported: -4mb"));
}
public void testParseModelMemoryLimitGivenZeroString() throws IOException {