@Test public void test_enable_raw() throws Exception { Fs.Builder builder = startCrawlerDefinition(); if (rarely()) { // Sometimes we explicitly set it but this is also the default value builder.setRawMetadata(true); } startCrawler(getCrawlerName(), builder.build(), endCrawlerDefinition(getCrawlerName()), null); ESSearchResponse searchResponse = countTestHelper(new ESSearchRequest().withIndex(getCrawlerName()), 1L, null); for (ESSearchHit hit : searchResponse.getHits()) { assertThat(extractFromPath(hit.getSourceAsMap(), Doc.FIELD_NAMES.META).get("raw"), notNullValue()); } } }
/** * The exact opposite of {@link #rarely()}. */ public static boolean frequently() { return !rarely(); }
/** * The exact opposite of {@link #rarely()}. */ public static boolean frequently() { return !rarely(); }
private static boolean sendBodyAsSourceParam(List<String> supportedMethods, String contentType) { if (supportedMethods.contains(HttpGet.METHOD_NAME)) { if (contentType.startsWith(ContentType.APPLICATION_JSON.getMimeType()) || contentType.startsWith(YAML_CONTENT_TYPE.getMimeType())) { return RandomizedTest.rarely(); } } return false; }