DeleteRequestBuilder { public DeleteRequestBuilder byQuery(String query){ if(this.request==null) this.request = new EagleServiceSingleEntityQueryRequest(); try { this.request.setQuery(URLEncoder.encode(query, "UTF-8")); } catch (UnsupportedEncodingException e) { LOG.error(e.getMessage(),e); } return this; } DeleteRequestBuilder(IEagleServiceClient client); DeleteRequestBuilder byId(List<String> ids); DeleteRequestBuilder byQuery(String query); DeleteRequestBuilder serviceName(String serviceName); DeleteRequestBuilder startRowkey(String startRowkey); DeleteRequestBuilder pageSize(int pageSize); DeleteRequestBuilder startTime(long startTime); DeleteRequestBuilder startTime(String startTime); DeleteRequestBuilder endTime(long endTime); DeleteRequestBuilder endTime(String endTime); DeleteRequestBuilder timeRange(String startTime,String endTime); DeleteRequestBuilder timeRange(long startTime,long endTime); DeleteRequestBuilder treeAgg(boolean treeAgg); DeleteRequestBuilder metricName(String metricName); DeleteRequestBuilder filterIfMissing(Boolean filterIfMissing); GenericServiceAPIResponseEntity<String> send();  }
@Test public void testDeleteRequestByQuery() throws Exception { EagleServiceConnector connector = mock(EagleServiceConnector.class); IEagleServiceClient client = new EagleServiceClientImpl(connector); DeleteRequestBuilder deleteRequestBuilder = client.delete().byQuery("AuditService"); Field deleteRequestField = DeleteRequestBuilder.class.getDeclaredField("request"); deleteRequestField.setAccessible(true); EagleServiceSingleEntityQueryRequest request = (EagleServiceSingleEntityQueryRequest)deleteRequestField.get(deleteRequestBuilder); Assert.assertEquals("query=AuditService&pageSize=0&treeAgg=false", request.getQueryParameterString()); }