use of com.github.tomakehurst.wiremock.common.ConsoleNotifier in project wiremock by wiremock.
the class PostServeActionExtensionTest method multipleActionsOfTheSameNameCanBeSpecifiedAsAJsonArray.
@Test
public void multipleActionsOfTheSameNameCanBeSpecifiedAsAJsonArray() {
initWithOptions(options().dynamicPort().notifier(new ConsoleNotifier(true)).extensions(new NamedCounterAction()));
WireMockResponse response = client.postJson("/__admin/mappings", "{\n" + " \"request\": {\n" + " \"urlPath\": \"/count-me\",\n" + " \"method\": \"GET\"\n" + " },\n" + " \"response\": {\n" + " \"status\": 200\n" + " },\n" + " \"postServeActions\": [\n" + " {\n" + " \"name\": \"count-request\",\n" + " \"parameters\": {\n" + " \"counterName\": \"one\" \n" + " }\n" + " },\n" + " {\n" + " \"name\": \"count-request\",\n" + " \"parameters\": {\n" + " \"counterName\": \"two\"\n" + " }\n" + " }\n" + " ]\n" + "}");
assertThat(response.content(), response.statusCode(), is(201));
client.get("/count-me");
client.get("/count-me");
client.get("/count-me");
await().atMost(5, SECONDS).until(getContent("/__admin/named-counter/one"), is("3"));
await().atMost(5, SECONDS).until(getContent("/__admin/named-counter/two"), is("3"));
}
use of com.github.tomakehurst.wiremock.common.ConsoleNotifier in project bacon by project-ncl.
the class AbstractTest method startWiremockServer.
@BeforeAll
static void startWiremockServer() {
wireMockServer = new WireMockServer(options().port(8080).notifier(new ConsoleNotifier(false)));
wireMockServer.start();
}
use of com.github.tomakehurst.wiremock.common.ConsoleNotifier in project PostExamples by deesebc.
the class FeignInterceptor method setup.
@BeforeAll
public static void setup() {
bookClient = Feign.builder().client(new OkHttpClient()).encoder(new GsonEncoder()).decoder(new GsonDecoder()).logger(new Slf4jLogger(BookClient.class)).logLevel(Logger.Level.FULL).requestInterceptor(new CustomTokenGeneratorInterceptor("123456", "654321")).target(BookClient.class, "http://localhost:57010/api/books");
wireMockServer = new WireMockServer(WireMockConfiguration.wireMockConfig().withRootDirectory(FOLDER).port(57010).notifier(new ConsoleNotifier(true)));
wireMockServer.start();
}
use of com.github.tomakehurst.wiremock.common.ConsoleNotifier in project PostExamples by deesebc.
the class WiremockTest method setup.
@BeforeEach
public void setup() {
wireMockServer = new WireMockServer(WireMockConfiguration.wireMockConfig().withRootDirectory(FOLDER).port(57002).httpsPort(57005).keystorePath(FOLDER + "/identity.jks").notifier(new ConsoleNotifier(true)));
wireMockServer.start();
}
use of com.github.tomakehurst.wiremock.common.ConsoleNotifier in project plugin-installation-manager-tool by jenkinsci.
the class PluginManagerWiremockTest method proxyToWireMock.
@Before
public void proxyToWireMock() {
archives = new WireMockServer(WireMockConfiguration.options().dynamicPort().notifier(new ConsoleNotifier(true)));
archives.start();
protectedArchives = new WireMockServer(WireMockConfiguration.options().dynamicPort().notifier(new ConsoleNotifier(true)));
protectedArchives.start();
cfg = Config.builder().withJenkinsWar(Settings.DEFAULT_WAR).withPluginDir(new File(folder.getRoot(), "plugins")).withCredentials(Collections.singletonList(new Credentials("myuser", "mypassword", "localhost", protectedArchives.port()))).build();
pm = new PluginManager(cfg);
if (record) {
archives.stubFor(proxyAllTo("http://archives.jenkins-ci.org").atPriority(1));
}
// the mappings from src/test/resources/mappings are used otherwise
}
Aggregations