我正在尝试使用Wiremock模拟我的ServiceA。但似乎缺少一些设置。我收到了这个错误:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /__files/serviceA/endpointA Reason:
<pre> Not Found</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.4.v20170414</a><hr/>
</body>
</html>
404意味着它没有找到端点位置。
是否有可以解释如何设置服务的分步教程?
感谢。
答案 0 :(得分:3)
有一些不同的方式:
INSERT ALL
WHEN (dwsact = 'I') THEN
INTO TARGET1 (ID,VAL,DELETED_FLAG,VALIDFROM,VALIDTO)
VALUES (ID, VAL, 'N', '11.09.17', to_date('59991231','YYYYMMDD'))
WHEN (dwsact = 'U') THEN
INTO STG.TMP_TABLE_FOR_UPDATE (PROWID)
VALUES (ROW_ID)
WHEN (dwsact = 'D') THEN
INTO STG.TMP_TABLE_FOR_DELETE (PROWID)
VALUES (ROW_ID)
SELECT t.ROWID AS ROW_ID, s.ID, s.VAL, s.DWSACT FROM SOURCE1 s JOIN TARGET1 t ON s.ID = t.ID
(见
http://wiremock.org/docs/running-standalone/)使用以下依赖项创建一个简单的maven项目:
java -jar wiremock-standalone-2.8.0.jar
然后创建一个运行它的主类:
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<version>2.8.0</version>
</dependency>
使用JUnit-Rule:
private static final WireMockServer server = new WireMockServer(options().port(8080));
public static void main(String[] args) {
server.stubFor(post(urlEqualTo("/localsave")).willReturn(aResponse().withStatus(HttpStatus.SC_OK)));
server.start();
//do some stuff
}
您可以在此处找到所有信息:http://wiremock.org/docs/
请告诉我这是否足够您的信息。