• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SingleRootFileSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.github.tomakehurst.wiremock.common.SingleRootFileSource的典型用法代码示例。如果您正苦于以下问题:Java SingleRootFileSource类的具体用法?Java SingleRootFileSource怎么用?Java SingleRootFileSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SingleRootFileSource类属于com.github.tomakehurst.wiremock.common包,在下文中一共展示了SingleRootFileSource类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startServers

import com.github.tomakehurst.wiremock.common.SingleRootFileSource; //导入依赖的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();

}
 
开发者ID:ordina-jworks,项目名称:microservices-dashboard-server,代码行数:18,代码来源:InMemoryDefaultWireMock.java


示例2: main

import com.github.tomakehurst.wiremock.common.SingleRootFileSource; //导入依赖的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);
        }
    }
 
开发者ID:arcuri82,项目名称:pg6100,代码行数:34,代码来源:WsRecorder.java


示例3: startServers

import com.github.tomakehurst.wiremock.common.SingleRootFileSource; //导入依赖的package包/类
@PostConstruct
public void startServers() throws IOException {
	WireMockConfiguration eurekaServerConfig = wireMockConfig().port(HTTP_PORT).fileSource(new SingleRootFileSource("src/test/resources/mocks/forwardauthheader/eureka"));
	eurekaServer = new WireMockServer(eurekaServerConfig);
	eurekaServer.start();

	WireMockConfiguration secureConfig = wireMockConfig().port(HTTPS_HTTP_PORT).httpsPort(HTTPS_PORT).fileSource(new SingleRootFileSource("src/test/resources/mocks/forwardauthheader/secure"));
	secureServer = new WireMockServer(secureConfig);
	secureServer.start();
}
 
开发者ID:ordina-jworks,项目名称:microservices-dashboard-server,代码行数:11,代码来源:InMemoryForwardInboundAuthHeaderWireMock.java


示例4: startServers

import com.github.tomakehurst.wiremock.common.SingleRootFileSource; //导入依赖的package包/类
@PostConstruct
public void startServers() throws IOException {
	WireMockConfiguration eurekaServerConfig = wireMockConfig().port(HTTP_PORT).fileSource(new SingleRootFileSource("src/test/resources/mocks/forwardoauth2token/eureka"));
	eurekaServer = new WireMockServer(eurekaServerConfig);
	eurekaServer.start();

	WireMockConfiguration secureConfig = wireMockConfig().port(HTTPS_HTTP_PORT).httpsPort(HTTPS_PORT).fileSource(new SingleRootFileSource("src/test/resources/mocks/forwardoauth2token/secure"));
	secureServer = new WireMockServer(secureConfig);
	secureServer.start();
}
 
开发者ID:ordina-jworks,项目名称:microservices-dashboard-server,代码行数:11,代码来源:InMemoryForwardOAuth2TokenWireMock.java


示例5: setUpReplay

import com.github.tomakehurst.wiremock.common.SingleRootFileSource; //导入依赖的package包/类
@BeforeMethod(groups = {"standAloneTest"})
public void setUpReplay() throws Exception {
    /*Generate these replay files by doing this

    wget http://repo1.maven.org/maven2/com/github/tomakehurst/wiremock/1.42/wiremock-1.42-standalone.jar
    java -jar wiremock-1.42-standalone.jar --proxy-all="http://achernar:7880/" --record-mappings --verbose

    Do the test you need to get the recording
    Stop the recording server with Ctrl-C when you have sufficient material

    It will generate two folders, mapping and __files. Copy these to src/test/resources/fedoraIteratorReplay
    */
    if (replay) {

        File file = new File(
                Thread.currentThread().getContextClassLoader().getResource("ITconfig.properties").toURI());
        File srcTestResources = file.getParentFile();
        File fedoraIteratorReplay = new File(srcTestResources, "fedoraIteratorReplay");
        File mappings = new File(fedoraIteratorReplay, "mappings");

        wireMockServer = new WireMockServer(8089, new SingleRootFileSource(fedoraIteratorReplay), false);
        wireMockServer.start();

        wireMockServer.loadMappingsUsing(
                new JsonFileMappingsLoader(
                        new SingleRootFileSource(
                                mappings.getAbsolutePath())));
        WireMock.configureFor("localhost", wireMockServer.port());
    }
}
 
开发者ID:statsbiblioteket,项目名称:newspaper-batch-event-framework,代码行数:31,代码来源:IteratorForFedora3TestWireMocked.java


示例6: FakeServer

import com.github.tomakehurst.wiremock.common.SingleRootFileSource; //导入依赖的package包/类
FakeServer(int port, String pathToLoad) {
    this.wireMockServer =
            new WireMockServer(port,
                    new SingleRootFileSource(Config.ROOT_PATH + pathToLoad),
                    false);
}
 
开发者ID:maximn,项目名称:jsif,代码行数:7,代码来源:FakeServer.java


示例7: startWireMock

import com.github.tomakehurst.wiremock.common.SingleRootFileSource; //导入依赖的package包/类
@PostConstruct
public void startWireMock() throws IOException {
    wireMockServer = new WireMockServer(wireMockConfig().port(8089).fileSource(new SingleRootFileSource("src/main/resources/mocks")));
    wireMockServer.start();
}
 
开发者ID:ordina-jworks,项目名称:microservices-dashboard-server,代码行数:6,代码来源:InMemoryWireMock.java


示例8: setupServer

import com.github.tomakehurst.wiremock.common.SingleRootFileSource; //导入依赖的package包/类
@BeforeClass
public static void setupServer() {
    buildWireMock(wireMockConfig());
    wireMockServer.loadMappingsUsing(new JsonFileMappingsLoader(
            new SingleRootFileSource("src/test/resources/mappings")));
}
 
开发者ID:OfficeDev,项目名称:orc-for-android,代码行数:7,代码来源:WireMockTestBase.java



注:本文中的com.github.tomakehurst.wiremock.common.SingleRootFileSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XulListbox类代码示例发布时间:2022-05-22
下一篇:
Java Whitelisted类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap