本文整理汇总了Java中com.github.tomakehurst.wiremock.common.ConsoleNotifier类的典型用法代码示例。如果您正苦于以下问题:Java ConsoleNotifier类的具体用法?Java ConsoleNotifier怎么用?Java ConsoleNotifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConsoleNotifier类属于com.github.tomakehurst.wiremock.common包,在下文中一共展示了ConsoleNotifier类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startServers
import com.github.tomakehurst.wiremock.common.ConsoleNotifier; //导入依赖的package包/类
@PostConstruct
public void startServers() throws IOException {
WireMockConfiguration eurekaServerConfig = wireMockConfig()
.notifier(new ConsoleNotifier(true))
.port(HTTP_PORT)
.fileSource(new SingleRootFileSource("src/test/resources/mocks/default/eureka"));
eurekaServer = new WireMockServer(eurekaServerConfig);
eurekaServer.start();
WireMockConfiguration secureConfig = wireMockConfig()
.notifier(new ConsoleNotifier(true))
.httpsPort(HTTPS_PORT)
.fileSource(new SingleRootFileSource("src/test/resources/mocks/default/secure"));
secureServer = new WireMockServer(secureConfig);
secureServer.start();
}
示例2: main
import com.github.tomakehurst.wiremock.common.ConsoleNotifier; //导入依赖的package包/类
public static void main(String[] args){
try {
int port = 8099;
WireMockServer server = new WireMockServer(
wireMockConfig().port(port).notifier(new ConsoleNotifier(true))
);
Path m = Paths.get("target/wiremock/mappings");
Path f = Paths.get("target/wiremock/files");
Files.createDirectories(m);
Files.createDirectories(f);
FileSource mappings = new SingleRootFileSource(m.toFile().getAbsolutePath());
FileSource files = new SingleRootFileSource(m.toFile().getAbsolutePath());
server.enableRecordMappings(mappings,files);
server.start();
NASDAQQuotesSoap soap = WsProvider.getNASDAQQuotesSoap("localhost:" + port);
server.stubFor(post(urlMatching(".*")).
willReturn(aResponse().proxiedFrom("http://" + WsProvider.NASDAQ_ADDRESS)));
for (MarketCenter mc : soap.listMarketCenters().getMarketCenter()) {
System.out.println(mc.getName());
}
server.stop();
} catch (Exception e){
e.printStackTrace();
} finally {
System.exit(0);
}
}