@Test public void testCreateMapping() throws Exception{ PowerMockito.mockStatic(CommonUtils.class); PowerMockito.when(CommonUtils.doHttpPut(anyString(), anyString())).thenReturn("{}"); String toReturn = ESUtils.createMapping(DUMMY_ES_HOST, "testIndex", "testType"); assertNotNull(toReturn); }
public static String createMapping(String esUrl, String index, String type) throws Exception { String url = new StringBuilder(esUrl).append("/").append(index).append("/").append(MAPPING).append("/") .append(type).toString(); return CommonUtils.doHttpPut(url, CREATE_MAPPING_REQUEST_BODY_TEMPLATE.replace(INPUT_TYPE, type)); }
ESUtils { public static String createMapping(String esUrl, String index, String type) throws Exception { String url = new StringBuilder(esUrl).append("/").append(index).append("/").append(MAPPING).append("/") .append(type).toString(); return CommonUtils.doHttpPut(url, CREATE_MAPPING_REQUEST_BODY_TEMPLATE.replace(INPUT_TYPE, type)); } }
ESUtils { public static String createMapping(String esUrl, String index, String type) throws Exception { String url = new StringBuilder(esUrl).append("/").append(index).append("/").append(MAPPING).append("/") .append(type).toString(); return CommonUtils.doHttpPut(url, CREATE_MAPPING_REQUEST_BODY_TEMPLATE.replace(INPUT_TYPE, type)); }  }
ESUtils { public static String createMapping(String esUrl, String index, String type) throws Exception { String url = new StringBuilder(esUrl).append("/").append(index).append("/").append(MAPPING).append("/") .append(type).toString(); return CommonUtils.doHttpPut(url, CREATE_MAPPING_REQUEST_BODY_TEMPLATE.replace(INPUT_TYPE, type)); }  static List<Map<String, String>> getResourcesFromEs(String index, String targetType,
            Map<String, String> filter, List<String> fields); @SuppressWarnings("unchecked") static long getTotalDocumentCountForIndexAndType(String url, String index, String type,
            Map<String, Object> filter, Map<String, Object> mustNotFilter, HashMultimap<String, Object> shouldFilter); static boolean isValidIndex(final String url, final String index); static boolean isValidType(final String url, final String index, final String type); static String getEsUrl(); static String createMapping(String esUrl, String index, String type); static String createMappingWithParent(String esUrl, String index, String type, String parentType); static void createIndex(String url, String indexName); static void ensureIndexAndTypeForAnnotation(Annotation annotation, Boolean createIndexIfNotFound); static String buildIndexNameFromAnnotation(final Annotation annotation); static String getIssueTypeFromAnnotation(Annotation annotation); @SuppressWarnings("unchecked") static List<Map<String, String>> getDataFromES(final String url, String dataSource, String entityType,
            Map<String, Object> mustFilter, final Map<String, Object> mustNotFilter,
            final HashMultimap<String, Object> shouldFilter, List<String> fields, long from, long size); static String convertAttributetoKeyword(String attributeName); static Map<String, String> getDocumentForId(String index, String targetType, String _id); static Boolean publishMetrics(Map<String, Object> evalResults,String type); static int getESPort(); static String getESHost(); static Boolean doESPublish(Map<String, Object> evalResults, String indexName, String type); static Boolean doESUpdate(String docId,Map<String, Object> evalResults, String indexName, String type); static String createKeyword(final String key); }
ESUtils { public static String createMapping(String esUrl, String index, String type) throws Exception { String url = new StringBuilder(esUrl).append("/").append(index).append("/").append(MAPPING).append("/") .append(type).toString(); return CommonUtils.doHttpPut(url, CREATE_MAPPING_REQUEST_BODY_TEMPLATE.replace(INPUT_TYPE, type)); }  static List<Map<String, String>> getResourcesFromEs(String index, String targetType,
            Map<String, String> filter, List<String> fields); @SuppressWarnings("unchecked") static long getTotalDocumentCountForIndexAndType(String url, String index, String type,
            Map<String, Object> filter, Map<String, Object> mustNotFilter, HashMultimap<String, Object> shouldFilter); static boolean isValidIndex(final String url, final String index); static boolean isValidType(final String url, final String index, final String type); static String getEsUrl(); static String createMapping(String esUrl, String index, String type); static String createMappingWithParent(String esUrl, String index, String type, String parentType); static void createIndex(String url, String indexName); static void ensureIndexAndTypeForAnnotation(Annotation annotation, Boolean createIndexIfNotFound); static String buildIndexNameFromAnnotation(final Annotation annotation); static String getIssueTypeFromAnnotation(Annotation annotation); @SuppressWarnings("unchecked") static List<Map<String, String>> getDataFromES(final String url, String dataSource, String entityType,
            Map<String, Object> mustFilter, final Map<String, Object> mustNotFilter,
            final HashMultimap<String, Object> shouldFilter, List<String> fields, long from, long size); static String convertAttributetoKeyword(String attributeName); static Map<String, String> getDocumentForId(String index, String targetType, String _id); static Boolean publishMetrics(Map<String, Object> evalResults,String type); static int getESPort(); static String getESHost(); static Boolean doESPublish(Map<String, Object> evalResults, String indexName, String type); static Boolean doESUpdate(String docId,Map<String, Object> evalResults, String indexName, String type); static String createKeyword(final String key);  }