<commit_before>WireMock - a tool for simulating HTTP services
==============================================


Key Features
------------
	
-	HTTP response stubbing, matchable on URL, header and body content patterns
-	Request verification
-	Runs in unit tests, as a standalone process or as a WAR app
-	Configurable via a fluent Java API, JSON files and JSON over HTTP
-	Record/playback of stubs
-	Fault injection
-	Per-request conditional proxying
-	Stateful behaviour simulation
-	Configurable response delays
 

Using with JUnit 4.x
--------------------

First, add WireMock as a dependency to your project. If you're using Maven, you can do this by adding this to your POM:

	<repositories>
		<repository>
			<id>tomakehurst-mvn-repo-releases</id>
			<name><NAME>st's Maven Release Repo</name>
			<url>http://tomakehurst.github.com/tomakehurst-mvn-repo/releases</url>
			<layout>default</layout>
		</repository>
	</repositories>
	
		
...and this to your dependencies:

	<dependency>
		<groupId>com.github.tomakehurst</groupId>
		<artifactId>wiremock</artifactId>
		<version>1.18</version>
	</dependency>


In your test class, add this:

	@Rule
	public WireMockRule wireMockRule = new WireMockRule(8089); // No-args constructor defaults to port 8080
	

You can then write a test case like this:
	
	@Test
	public void exampleTest() {
		stubFor(get(urlEqualTo("/my/resource"))
				.withHeader("Accept", equalTo("text/xml"))
				.willReturn(aResponse()
					.withStatus(200)
					.withHeader("Content-Type", "text/xml")<commit_msg>Updated README to reflect the move to maven central.<commit_after>WireMock - a tool for simulating HTTP services
==============================================


Key Features
------------
	
-	HTTP response stubbing, matchable on URL, header and body content patterns
-	Request verification
-	Runs in unit tests, as a standalone process or as a WAR app
-	Configurable via a fluent Java API, JSON files and JSON over HTTP
-	Record/playback of stubs
-	Fault injection
-	Per-request conditional proxying
-	Stateful behaviour simulation
-	Configurable response delays
 

Using with JUnit 4.x
--------------------

First, add WireMock as a dependency to your project:

	<dependency>
		<groupId>com.github.tomakehurst</groupId>
		<artifactId>wiremock</artifactId>
		<version>1.18</version>
	</dependency>

Note to anyone who's used previous versions: WireMock is in Maven Central now, so it's no longer necessary to add my repo to your POM.

In your test class, add this:

	@Rule
	public WireMockRule wireMockRule = new WireMockRule(8089); // No-args constructor defaults to port 8080
	

You can then write a test case like this:
	
	@Test
	public void exampleTest() {
		stubFor(get(urlEqualTo("/my/resource"))
				.withHeader("Accept", equalTo("text/xml"))
				.willReturn(aResponse()
					.withStatus(200)
					.withHeader("Content-Type", "text/xml")
{'fraction_non_alphanumeric': 0.14191304347826086, 'fraction_numerical': 0.010434782608695653, 'mean_word_length': 3.7853577371048255, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6752633', 'n_tokens_mistral': 951, 'n_tokens_neox': 822, 'n_words': 296}