com.github.tomakehurst.wiremock.client.WireMock.delete()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中com.github.tomakehurst.wiremock.client.WireMock.delete()方法的一些代码示例,展示了WireMock.delete()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WireMock.delete()方法的具体详情如下:
包路径:com.github.tomakehurst.wiremock.client.WireMock
类名称:WireMock
方法名:delete

WireMock.delete介绍

暂无

代码示例

代码示例来源:origin: com.github.tomakehurst/wiremock-jre8

public static MappingBuilder delete(String url) {
  return delete(urlEqualTo(url));
}

代码示例来源:origin: georocket/georocket

/**
  * Test if properties can be can be removed
  * @param context the test context
  */
 @Test
 public void removeProperties(TestContext context) {
  String url = "/store/?search=test&properties=a%3D1,b%3D2";
  stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
    .withStatus(204)));
  List<String> tags = Arrays.asList("a=1", "b=2");
  Async async = context.async();
  client.getStore().removeProperties("test", "/", tags, ar -> {
   context.assertTrue(ar.succeeded());
   async.complete();
  });
 }
}

代码示例来源:origin: georocket/georocket

/**
  * Test if tags can be can be removed
  * @param context the test context
  */
 @Test
 public void removeTags(TestContext context) {
  String url = "/store/?search=test&tags=a,b,c";
  stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
    .withStatus(204)));
  List<String> tags = Arrays.asList("a", "b", "c");
  Async async = context.async();
  client.getStore().removeTags("test", "/", tags, ar -> {
   context.assertTrue(ar.succeeded());
   async.complete();
  });
 }
}

代码示例来源:origin: georocket/georocket

/**
 * Test a delete with a simple query
 * @param context the test context
 */
@Test
public void simpleQueryDelete(TestContext context) {
 String url = "/store/?search=test";
 stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
     .withStatus(204)));
 
 Async async = context.async();
 client.getStore().delete("test", context.asyncAssertSuccess(v -> {
  verifyDeleted(url, context);
  async.complete();
 }));
}

代码示例来源:origin: georocket/georocket

/**
 * Test a delete with query that consists of two terms
 * @param context the test context
 */
@Test
public void twoTermsQueryDelete(TestContext context) {
 String url = "/store/?search=test1%20test2";
 stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
     .withStatus(204)));
 
 Async async = context.async();
 client.getStore().delete("test1 test2", context.asyncAssertSuccess(v -> {
  verifyDeleted(url, context);
  async.complete();
 }));
}

代码示例来源:origin: georocket/georocket

/**
  * Test a delete with a layer and a query
  * @param context the test context
  * @throws Exception if something goes wrong
  */
 @Test
 public void layerQuery(TestContext context) throws Exception {
  String url = "/store/hello/world/?search=test";
  stubFor(delete(urlEqualTo(url))
    .willReturn(aResponse()
      .withStatus(204)));
  
  Async async = context.async();
  client.getStore().delete("test", "hello/world", context.asyncAssertSuccess(v -> {
   verifyDeleted(url, context);
   async.complete();
  }));
 }
}

代码示例来源:origin: georocket/georocket

/**
 * Test to delete the root layer
 * @param context the test context
 */
@Test
public void rootLayer(TestContext context) {
 String url = "/store/";
 stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
     .withStatus(204)));
 
 Async async = context.async();
 client.getStore().delete(null, "/", context.asyncAssertSuccess(v -> {
  verifyDeleted(url, context);
  async.complete();
 }));
}

代码示例来源:origin: georocket/georocket

/**
 * Test a delete with a layer but no query
 * @param context the test context
 * @throws Exception if something goes wrong
 */
@Test
public void layerNoQuery(TestContext context) throws Exception {
 String url = "/store/hello/world/";
 stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
     .withStatus(204)));
 
 Async async = context.async();
 client.getStore().delete(null, "hello/world", context.asyncAssertSuccess(v -> {
  verifyDeleted(url, context);
  async.complete();
 }));
}

代码示例来源:origin: georocket/georocket

/**
  * Test a delete with a layer and a query
  * @param context the test context
  * @throws Exception if something goes wrong
  */
 @Test
 public void layerQuery(TestContext context) throws Exception {
  String url = "/store/hello/world/?search=test";
  stubFor(delete(urlEqualTo(url))
    .willReturn(aResponse()
      .withStatus(204)));
  
  Async async = context.async();
  cmd.setEndHandler(exitCode -> {
   context.assertEquals(0, exitCode);
   verifyDeleted(url, context);
   async.complete();
  });
  
  cmd.run(new String[] { "-l", "hello/world", "test" }, in, out);
 }
}

代码示例来源:origin: georocket/georocket

/**
 * Test a delete with query that consists of two terms
 * @param context the test context
 * @throws Exception if something goes wrong
 */
@Test
public void twoTermsQueryDelete(TestContext context) throws Exception {
 String url = "/store/?search=test1%20test2";
 stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
     .withStatus(204)));
 
 Async async = context.async();
 cmd.setEndHandler(exitCode -> {
  context.assertEquals(0, exitCode);
  verifyDeleted(url, context);
  async.complete();
 });
 
 cmd.run(new String[] { "test1", "test2" }, in, out);
}

代码示例来源:origin: georocket/georocket

/**
 * Test a delete with a simple query
 * @param context the test context
 * @throws Exception if something goes wrong
 */
@Test
public void simpleQueryDelete(TestContext context) throws Exception {
 String url = "/store/?search=test";
 stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
     .withStatus(204)));
 
 Async async = context.async();
 cmd.setEndHandler(exitCode -> {
  context.assertEquals(0, exitCode);
  verifyDeleted(url, context);
  async.complete();
 });
 
 cmd.run(new String[] { "test" }, in, out);
}

代码示例来源:origin: georocket/georocket

/**
 * Test a delete with a layer but no query
 * @param context the test context
 * @throws Exception if something goes wrong
 */
@Test
public void layerNoQuery(TestContext context) throws Exception {
 String url = "/store/hello/world/";
 stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
     .withStatus(204)));
 
 Async async = context.async();
 cmd.setEndHandler(exitCode -> {
  context.assertEquals(0, exitCode);
  verifyDeleted(url, context);
  async.complete();
 });
 
 cmd.run(new String[] { "-l", "hello/world" }, in, out);
}

代码示例来源:origin: georocket/georocket

/**
 * Test to delete the root layer
 * @param context the test context
 * @throws Exception if something goes wrong
 */
@Test
public void rootLayer(TestContext context) throws Exception {
 String url = "/store/";
 stubFor(delete(urlEqualTo(url))
   .willReturn(aResponse()
     .withStatus(204)));
 
 Async async = context.async();
 cmd.setEndHandler(exitCode -> {
  context.assertEquals(0, exitCode);
  verifyDeleted(url, context);
  async.complete();
 });
 
 cmd.run(new String[] { "-l", "/" }, in, out);
}

代码示例来源:origin: georocket/georocket

delete(urlPathEqualTo(pathWithLeadingSlash(S3_BUCKET, ID)))
delete(urlPathEqualTo(pathWithLeadingSlash(S3_BUCKET, TEST_FOLDER, ID)))

相关文章