.setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()));
}
+ public void bulkApplyTemplate(BulkApplyTemplateWsRequest request) {
+ call(new PostRequest(path("bulk_apply_template"))
+ .setParam(PARAM_TEMPLATE_ID, request.getTemplateId())
+ .setParam(PARAM_TEMPLATE_NAME, request.getTemplateName())
+ .setParam("q", request.getQuery())
+ .setParam(PARAM_QUALIFIER, request.getQualifier())
+ );
+ }
+
public CreateTemplateWsResponse createTemplate(CreateTemplateWsRequest request) {
PostRequest post = new PostRequest(path("create_template"))
.setParam(PARAM_NAME, request.getName())
.andNoOtherParam();
}
+ @Test
+ public void bulk_apply_template() {
+ underTest.bulkApplyTemplate(new BulkApplyTemplateWsRequest()
+ .setTemplateId(TEMPLATE_ID_VALUE)
+ .setTemplateName(TEMPLATE_NAME_VALUE)
+ .setQualifier(QUALIFIER_VALUE)
+ .setQuery(QUERY_VALUE));
+
+ assertThat(serviceTester.getPostParser()).isNull();
+ PostRequest postRequest = serviceTester.getPostRequest();
+ serviceTester.assertThat(postRequest)
+ .hasPath("bulk_apply_template")
+ .hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE)
+ .hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE)
+ .hasParam("q", QUERY_VALUE)
+ .hasParam(PARAM_QUALIFIER, QUALIFIER_VALUE)
+ .andNoOtherParam();
+ }
+
@Test
public void createTemplate_does_POST_on_Ws_create_template() {
underTest.createTemplate(new CreateTemplateWsRequest()