diff --git a/build.gradle b/build.gradle
index d586b93..53b767f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,25 +1,25 @@
buildscript {
repositories {
+ google()
jcenter()
- maven { url "http://maven.google.com" }
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.3'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
+ classpath 'com.android.tools.build:gradle:3.0.0'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
allprojects {
repositories {
+ google()
jcenter()
- maven { url "http://maven.google.com" }
}
}
ext {
minSdkVersion = 15
- targetSdkVersion = 25
+ targetSdkVersion = 27
versionCode = Integer.parseInt(VERSION_CODE)
versionName = VERSION_NAME
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 9550717..cb1528e 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
diff --git a/requestmatcher/build.gradle b/requestmatcher/build.gradle
index 2b6ee01..474a518 100644
--- a/requestmatcher/build.gradle
+++ b/requestmatcher/build.gradle
@@ -4,8 +4,8 @@ apply from: "$rootDir/tools/publish.gradle"
apply from: "$rootDir/tools/jacoco.gradle"
android {
- compileSdkVersion 26
- buildToolsVersion "26.0.0"
+ compileSdkVersion 27
+ buildToolsVersion '27.0.0'
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
@@ -25,40 +25,42 @@ android {
}
sourceSets {
- androidTest.java.srcDirs += "src/test-common/java"
- test.java.srcDirs += "src/test-common/java"
+ androidTest.java.srcDirs += 'src/test-common/java'
+ test.java.srcDirs += 'src/test-common/java'
}
}
+final supportLibrary = '27.0.0'
final junit = '4.12'
-final jsonPathAssert = '2.2.0'
+final jsonPathAssert = '2.4.0'
final hamcrest = '1.3'
-final okhttpVersion = '3.8.0'
-final testRunner = '0.5'
+final okhttpVersion = '3.9.0'
+final astl = '1.0.1'
dependencies {
- provided "junit:junit:$junit"
- provided "com.jayway.jsonpath:json-path-assert:$jsonPathAssert"
- provided "org.hamcrest:hamcrest-all:$hamcrest"
- provided "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
- provided "com.android.support.test:runner:$testRunner"
+ compileOnly "junit:junit:$junit"
+ compileOnly "com.jayway.jsonpath:json-path-assert:$jsonPathAssert"
+ compileOnly "org.hamcrest:hamcrest-all:$hamcrest"
+ compileOnly "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
+ compileOnly "com.android.support.test:runner:$astl"
- testCompile "junit:junit:$junit"
- testCompile "com.jayway.jsonpath:json-path-assert:$jsonPathAssert"
- testCompile "org.hamcrest:hamcrest-all:$hamcrest"
- testCompile "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
- testCompile "com.squareup.okhttp3:okhttp:$okhttpVersion"
- testCompile 'org.robolectric:robolectric:3.3.2'
- testCompile 'org.mockito:mockito-all:1.10.19'
+ testImplementation "junit:junit:$junit"
+ testImplementation "com.jayway.jsonpath:json-path-assert:$jsonPathAssert"
+ testImplementation "org.hamcrest:hamcrest-all:$hamcrest"
+ testImplementation "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
+ testImplementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
+ testImplementation 'org.robolectric:robolectric:3.5'
+ testImplementation 'org.mockito:mockito-core:2.11.0'
+ testImplementation "com.android.support:support-annotations:$supportLibrary"
- androidTestCompile "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
- androidTestCompile("com.jayway.jsonpath:json-path-assert:$jsonPathAssert") {
+ androidTestImplementation "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
+ androidTestImplementation("com.jayway.jsonpath:json-path-assert:$jsonPathAssert") {
exclude group: "org.ow2.asm"
}
- androidTestCompile "com.squareup.okhttp3:okhttp:$okhttpVersion"
- androidTestCompile "com.android.support.test.espresso:espresso-core:2.2.2"
- androidTestCompile "com.android.support.test:runner:0.5"
- androidTestCompile 'com.android.support:support-annotations:25.4.0'
+ androidTestImplementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+ androidTestImplementation "com.android.support.test:runner:$astl"
+ androidTestImplementation "com.android.support:support-annotations:$supportLibrary"
}
diff --git a/requestmatcher/src/androidTest/java/br/com/concretesolutions/requestmatcher/test/InstrumentedExceptionInStatementTest.java b/requestmatcher/src/androidTest/java/br/com/concrete/requestmatcher/test/InstrumentedExceptionInStatementTest.java
similarity index 62%
rename from requestmatcher/src/androidTest/java/br/com/concretesolutions/requestmatcher/test/InstrumentedExceptionInStatementTest.java
rename to requestmatcher/src/androidTest/java/br/com/concrete/requestmatcher/test/InstrumentedExceptionInStatementTest.java
index b4b6c3e..e353129 100644
--- a/requestmatcher/src/androidTest/java/br/com/concretesolutions/requestmatcher/test/InstrumentedExceptionInStatementTest.java
+++ b/requestmatcher/src/androidTest/java/br/com/concrete/requestmatcher/test/InstrumentedExceptionInStatementTest.java
@@ -1,11 +1,11 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
import android.support.test.runner.AndroidJUnit4;
import org.junit.runner.RunWith;
-import br.com.concretesolutions.requestmatcher.InstrumentedTestRequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.InstrumentedTestRequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
@RunWith(AndroidJUnit4.class)
public class InstrumentedExceptionInStatementTest extends ExceptionInStatementTest {
diff --git a/requestmatcher/src/androidTest/java/br/com/concretesolutions/requestmatcher/test/InstrumentedExceptionWitouhtEnqueuesTest.java b/requestmatcher/src/androidTest/java/br/com/concrete/requestmatcher/test/InstrumentedExceptionWitouhtEnqueuesTest.java
similarity index 55%
rename from requestmatcher/src/androidTest/java/br/com/concretesolutions/requestmatcher/test/InstrumentedExceptionWitouhtEnqueuesTest.java
rename to requestmatcher/src/androidTest/java/br/com/concrete/requestmatcher/test/InstrumentedExceptionWitouhtEnqueuesTest.java
index 89c4847..b469340 100644
--- a/requestmatcher/src/androidTest/java/br/com/concretesolutions/requestmatcher/test/InstrumentedExceptionWitouhtEnqueuesTest.java
+++ b/requestmatcher/src/androidTest/java/br/com/concrete/requestmatcher/test/InstrumentedExceptionWitouhtEnqueuesTest.java
@@ -1,12 +1,11 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
import android.support.test.runner.AndroidJUnit4;
import org.junit.runner.RunWith;
-import br.com.concretesolutions.requestmatcher.InstrumentedTestRequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.LocalTestRequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.InstrumentedTestRequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
@RunWith(AndroidJUnit4.class)
public class InstrumentedExceptionWitouhtEnqueuesTest extends ExceptionWitouhtEnqueuesTest {
diff --git a/requestmatcher/src/androidTest/java/br/com/concretesolutions/requestmatcher/test/InstrumentedRequestMatcherRuleTest.java b/requestmatcher/src/androidTest/java/br/com/concrete/requestmatcher/test/InstrumentedRequestMatcherRuleTest.java
similarity index 62%
rename from requestmatcher/src/androidTest/java/br/com/concretesolutions/requestmatcher/test/InstrumentedRequestMatcherRuleTest.java
rename to requestmatcher/src/androidTest/java/br/com/concrete/requestmatcher/test/InstrumentedRequestMatcherRuleTest.java
index 936f3f7..1ec5efe 100644
--- a/requestmatcher/src/androidTest/java/br/com/concretesolutions/requestmatcher/test/InstrumentedRequestMatcherRuleTest.java
+++ b/requestmatcher/src/androidTest/java/br/com/concrete/requestmatcher/test/InstrumentedRequestMatcherRuleTest.java
@@ -1,11 +1,11 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
import android.support.test.runner.AndroidJUnit4;
import org.junit.runner.RunWith;
-import br.com.concretesolutions.requestmatcher.InstrumentedTestRequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.InstrumentedTestRequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
@RunWith(AndroidJUnit4.class)
public class InstrumentedRequestMatcherRuleTest extends RequestMatcherRuleTest {
diff --git a/requestmatcher/src/main/AndroidManifest.xml b/requestmatcher/src/main/AndroidManifest.xml
index 763e824..988bacb 100644
--- a/requestmatcher/src/main/AndroidManifest.xml
+++ b/requestmatcher/src/main/AndroidManifest.xml
@@ -1,13 +1 @@
-
-
-
-
-
-
-
-
-
+
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/IOReader.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/IOReader.java
similarity index 98%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/IOReader.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/IOReader.java
index e592d10..1b78918 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/IOReader.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/IOReader.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher;
+package br.com.concrete.requestmatcher;
import android.util.Log;
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/InstrumentedTestRequestMatcherRule.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/InstrumentedTestRequestMatcherRule.java
similarity index 97%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/InstrumentedTestRequestMatcherRule.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/InstrumentedTestRequestMatcherRule.java
index 1142e11..9ceb1f5 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/InstrumentedTestRequestMatcherRule.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/InstrumentedTestRequestMatcherRule.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher;
+package br.com.concrete.requestmatcher;
import android.support.test.InstrumentationRegistry;
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/LocalTestRequestMatcherRule.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/LocalTestRequestMatcherRule.java
similarity index 97%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/LocalTestRequestMatcherRule.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/LocalTestRequestMatcherRule.java
index 7c25499..0667276 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/LocalTestRequestMatcherRule.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/LocalTestRequestMatcherRule.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher;
+package br.com.concrete.requestmatcher;
import java.io.IOException;
import java.io.InputStream;
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/MatcherDispatcher.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/MatcherDispatcher.java
similarity index 94%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/MatcherDispatcher.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/MatcherDispatcher.java
index 458d0fc..a72e673 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/MatcherDispatcher.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/MatcherDispatcher.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher;
+package br.com.concrete.requestmatcher;
import java.util.Collections;
import java.util.Set;
@@ -7,8 +7,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import br.com.concretesolutions.requestmatcher.exception.NoMatchersForRequestException;
-import br.com.concretesolutions.requestmatcher.exception.RequestAssertionException;
+import br.com.concrete.requestmatcher.exception.NoMatchersForRequestException;
+import br.com.concrete.requestmatcher.exception.RequestAssertionException;
import okhttp3.mockwebserver.Dispatcher;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.RecordedRequest;
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/RequestMatcherRule.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/RequestMatcherRule.java
similarity index 86%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/RequestMatcherRule.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/RequestMatcherRule.java
index ef0be8a..e9d38e8 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/RequestMatcherRule.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/RequestMatcherRule.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher;
+package br.com.concrete.requestmatcher;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
@@ -11,7 +11,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import br.com.concretesolutions.requestmatcher.exception.RequestAssertionException;
+import br.com.concrete.requestmatcher.exception.RequestAssertionException;
import okhttp3.HttpUrl;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
@@ -172,10 +172,11 @@ public IfRequestMatches addResponse(MockResponse response)
* Adds a fixture to be used during the test case.
*
* @param fixturePath The path of the fixture inside the fixtures folder.
+ * @param values Optional dynamic values to be replaced in the fixture file
* @return A dsl instance {@link IfRequestMatches} for chaining
*/
- public IfRequestMatches addFixture(String fixturePath) {
- return addFixture(200, fixturePath);
+ public IfRequestMatches addFixture(String fixturePath, String... values) {
+ return addFixture(200, fixturePath, values);
}
/**
@@ -183,13 +184,12 @@ public IfRequestMatches addFixture(String fixturePath) {
*
* @param fixturePath The path of the fixture inside the fixtures folder.
* @param statusCode The status of the mocked response.
+ * @param values Optional dynamic values to be replaced in the fixture file
* @return A dsl instance {@link IfRequestMatches} for chaining
*/
- public IfRequestMatches addFixture(int statusCode, String fixturePath) {
+ public IfRequestMatches addFixture(int statusCode, String fixturePath, String... values) {
- final MockResponse mockResponse = new MockResponse()
- .setResponseCode(statusCode)
- .setBody(readFixture(fixturePath));
+ final MockResponse mockResponse = createMockResponse(statusCode, fixturePath, values);
if (guessMimeType) {
final String mimeType = IOReader.mimeTypeFromExtension(fixturePath);
@@ -213,13 +213,15 @@ public IfRequestMatches addFixture(int statusCode, String
*
* @param fixturePath The path of the fixture inside the fixtures fodler.
* @param matcher The {@link RequestMatchersGroup} instance to use for matching.
+ * @param values Optional dynamic values to be replaced in the fixture file
* @return A dsl instance {@link IfRequestMatches} for chaining
*/
public IfRequestMatches addFixture(String fixturePath,
- T matcher) {
+ T matcher,
+ String... values) {
return addResponse(new MockResponse()
.setResponseCode(200)
- .setBody(readFixture(fixturePath)), matcher);
+ .setBody(replaceAndValidate(readFixture(fixturePath), values)), matcher);
}
/**
@@ -228,14 +230,38 @@ public IfRequestMatches addFixture(String fi
* @param statusCode The status of the mocked response.
* @param fixturePath The path of the fixture inside the fixtures fodler.
* @param matcher The {@link RequestMatchersGroup} instance to use for matching.
+ * @param values Optional dynamic values to be replaced in the fixture file
* @return A dsl instance {@link IfRequestMatches} for chaining
*/
public IfRequestMatches addFixture(int statusCode,
String fixturePath,
- T matcher) {
+ T matcher,
+ String... values) {
return addResponse(new MockResponse()
.setResponseCode(statusCode)
- .setBody(readFixture(fixturePath)), matcher);
+ .setBody(replaceAndValidate(readFixture(fixturePath), values)), matcher);
+ }
+
+ private MockResponse createMockResponse(int statusCode, String fixturePath, String... values) {
+ return new MockResponse()
+ .setResponseCode(statusCode)
+ .setBody(replaceAndValidate(readFixture(fixturePath), values));
+ }
+
+ private String replaceAndValidate(String fixture, String[] values) {
+ if (values == null) {
+ return fixture;
+ }
+
+ for (int i = 0; i < values.length; i++) {
+ if (!fixture.contains("{" + i + "}")) {
+ fail("Could not replace dynamic value at position " + i);
+ }
+
+ fixture = fixture.replace("{" + i + "}", values[i]);
+ }
+
+ return fixture;
}
/**
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/RequestMatchersGroup.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/RequestMatchersGroup.java
similarity index 97%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/RequestMatchersGroup.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/RequestMatchersGroup.java
index ea68e89..71d6d8c 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/RequestMatchersGroup.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/RequestMatchersGroup.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher;
+package br.com.concrete.requestmatcher;
import android.support.annotation.NonNull;
@@ -7,10 +7,10 @@
import java.util.HashMap;
import java.util.Map;
-import br.com.concretesolutions.requestmatcher.model.HttpMethod;
+import br.com.concrete.requestmatcher.model.HttpMethod;
import okhttp3.mockwebserver.RecordedRequest;
-import static br.com.concretesolutions.requestmatcher.matchers.IsMapWithSize.anEmptyMap;
+import static br.com.concrete.requestmatcher.matchers.IsMapWithSize.anEmptyMap;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.hasEntry;
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/RequestUtils.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/RequestUtils.java
similarity index 97%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/RequestUtils.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/RequestUtils.java
index fdb7fbf..af03392 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/RequestUtils.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/RequestUtils.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher;
+package br.com.concrete.requestmatcher;
import java.util.HashMap;
import java.util.List;
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/exception/NoMatchersForRequestException.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/exception/NoMatchersForRequestException.java
similarity index 94%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/exception/NoMatchersForRequestException.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/exception/NoMatchersForRequestException.java
index c18637d..e9d4a8c 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/exception/NoMatchersForRequestException.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/exception/NoMatchersForRequestException.java
@@ -1,6 +1,6 @@
-package br.com.concretesolutions.requestmatcher.exception;
+package br.com.concrete.requestmatcher.exception;
-import br.com.concretesolutions.requestmatcher.RequestMatchersGroup;
+import br.com.concrete.requestmatcher.RequestMatchersGroup;
import okhttp3.Headers;
import okhttp3.mockwebserver.RecordedRequest;
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/exception/OrderException.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/exception/OrderException.java
similarity index 85%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/exception/OrderException.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/exception/OrderException.java
index 465ad73..c6398db 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/exception/OrderException.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/exception/OrderException.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher.exception;
+package br.com.concrete.requestmatcher.exception;
import java.util.Locale;
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/exception/RequestAssertionException.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/exception/RequestAssertionException.java
similarity index 77%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/exception/RequestAssertionException.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/exception/RequestAssertionException.java
index 532ca7d..712f674 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/exception/RequestAssertionException.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/exception/RequestAssertionException.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher.exception;
+package br.com.concrete.requestmatcher.exception;
public final class RequestAssertionException extends RuntimeException {
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/matchers/IsMapWithSize.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/matchers/IsMapWithSize.java
similarity index 97%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/matchers/IsMapWithSize.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/matchers/IsMapWithSize.java
index 9801009..9e595fa 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/matchers/IsMapWithSize.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/matchers/IsMapWithSize.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher.matchers;
+package br.com.concrete.requestmatcher.matchers;
import org.hamcrest.FeatureMatcher;
diff --git a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/model/HttpMethod.java b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/model/HttpMethod.java
similarity index 90%
rename from requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/model/HttpMethod.java
rename to requestmatcher/src/main/java/br/com/concrete/requestmatcher/model/HttpMethod.java
index ed47b21..e8889da 100644
--- a/requestmatcher/src/main/java/br/com/concretesolutions/requestmatcher/model/HttpMethod.java
+++ b/requestmatcher/src/main/java/br/com/concrete/requestmatcher/model/HttpMethod.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher.model;
+package br.com.concrete.requestmatcher.model;
import okhttp3.mockwebserver.RecordedRequest;
diff --git a/requestmatcher/src/main/res/values/strings.xml b/requestmatcher/src/main/res/values/strings.xml
deleted file mode 100644
index db20f3e..0000000
--- a/requestmatcher/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Request Matcher
-
diff --git a/requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/BaseTest.java b/requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/BaseTest.java
new file mode 100644
index 0000000..d23368c
--- /dev/null
+++ b/requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/BaseTest.java
@@ -0,0 +1,9 @@
+package br.com.concrete.requestmatcher.test;
+
+
+import br.com.concrete.requestmatcher.RequestMatcherRule;
+
+public abstract class BaseTest {
+
+ protected abstract RequestMatcherRule getRequestMatcherRule();
+}
diff --git a/requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/ExceptionInStatementTest.java b/requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/ExceptionInStatementTest.java
similarity index 91%
rename from requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/ExceptionInStatementTest.java
rename to requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/ExceptionInStatementTest.java
index fc3580f..bae04b8 100644
--- a/requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/ExceptionInStatementTest.java
+++ b/requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/ExceptionInStatementTest.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
import org.junit.Before;
import org.junit.Rule;
@@ -10,10 +10,10 @@
import java.io.IOException;
import java.util.concurrent.TimeUnit;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatchersGroup;
-import br.com.concretesolutions.requestmatcher.exception.RequestAssertionException;
-import br.com.concretesolutions.requestmatcher.model.HttpMethod;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatchersGroup;
+import br.com.concrete.requestmatcher.exception.RequestAssertionException;
+import br.com.concrete.requestmatcher.model.HttpMethod;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
diff --git a/requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/ExceptionWitouhtEnqueuesTest.java b/requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/ExceptionWitouhtEnqueuesTest.java
similarity index 87%
rename from requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/ExceptionWitouhtEnqueuesTest.java
rename to requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/ExceptionWitouhtEnqueuesTest.java
index c2866de..a5c8dfb 100644
--- a/requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/ExceptionWitouhtEnqueuesTest.java
+++ b/requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/ExceptionWitouhtEnqueuesTest.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
import org.junit.Rule;
import org.junit.Test;
@@ -8,7 +8,7 @@
import java.io.IOException;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
public abstract class ExceptionWitouhtEnqueuesTest extends BaseTest {
diff --git a/requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/RequestMatcherRuleTest.java b/requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/RequestMatcherRuleTest.java
similarity index 98%
rename from requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/RequestMatcherRuleTest.java
rename to requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/RequestMatcherRuleTest.java
index e4882f1..11526d1 100644
--- a/requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/RequestMatcherRuleTest.java
+++ b/requestmatcher/src/test-common/java/br/com/concrete/requestmatcher/test/RequestMatcherRuleTest.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
import org.junit.Before;
import org.junit.Rule;
@@ -10,10 +10,10 @@
import java.io.IOException;
import java.util.concurrent.TimeUnit;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatchersGroup;
-import br.com.concretesolutions.requestmatcher.exception.RequestAssertionException;
-import br.com.concretesolutions.requestmatcher.model.HttpMethod;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatchersGroup;
+import br.com.concrete.requestmatcher.exception.RequestAssertionException;
+import br.com.concrete.requestmatcher.model.HttpMethod;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
@@ -410,7 +410,8 @@ public void failsForUnknownJsonPath() throws IOException {
exceptionRule.expect(RequestAssertionException.class);
exceptionRule.expectMessage(
allOf(
- containsString("is json with json path \"$..[*]\" and is json with json " +
+ containsString("is json with json path \"$\" evaluated to " +
+ "(an instance of java.util.Map or an instance of java.util.List) and is json with json " +
"path \"$['unexisting']['path']\" evaluated to is \"value\")"),
containsString(RequestMatchersGroup.JSON_MSG)
));
diff --git a/requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/BaseTest.java b/requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/BaseTest.java
deleted file mode 100644
index 85b9196..0000000
--- a/requestmatcher/src/test-common/java/br/com/concretesolutions/requestmatcher/test/BaseTest.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package br.com.concretesolutions.requestmatcher.test;
-
-
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
-
-public abstract class BaseTest {
-
- protected abstract RequestMatcherRule getRequestMatcherRule();
-}
diff --git a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/IOReaderTest.java b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/IOReaderTest.java
similarity index 87%
rename from requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/IOReaderTest.java
rename to requestmatcher/src/test/java/br/com/concrete/requestmatcher/IOReaderTest.java
index 375fc49..c595f93 100644
--- a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/IOReaderTest.java
+++ b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/IOReaderTest.java
@@ -1,9 +1,6 @@
-package br.com.concretesolutions.requestmatcher;
+package br.com.concrete.requestmatcher;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.annotation.Config;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
diff --git a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/CustomRequestMatcherTest.java b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/CustomRequestMatcherTest.java
similarity index 88%
rename from requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/CustomRequestMatcherTest.java
rename to requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/CustomRequestMatcherTest.java
index f0dd219..55ce7c5 100644
--- a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/CustomRequestMatcherTest.java
+++ b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/CustomRequestMatcherTest.java
@@ -1,4 +1,4 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
import android.support.annotation.NonNull;
@@ -17,12 +17,12 @@
import java.net.Socket;
import java.util.concurrent.TimeUnit;
-import br.com.concretesolutions.requestmatcher.BuildConfig;
-import br.com.concretesolutions.requestmatcher.LocalTestRequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatchersGroup;
-import br.com.concretesolutions.requestmatcher.exception.NoMatchersForRequestException;
-import br.com.concretesolutions.requestmatcher.exception.RequestAssertionException;
+import br.com.concrete.requestmatcher.BuildConfig;
+import br.com.concrete.requestmatcher.LocalTestRequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatchersGroup;
+import br.com.concrete.requestmatcher.exception.NoMatchersForRequestException;
+import br.com.concrete.requestmatcher.exception.RequestAssertionException;
import okhttp3.Headers;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
diff --git a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/LocalExceptionInStatementTest.java b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/LocalExceptionInStatementTest.java
similarity index 61%
rename from requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/LocalExceptionInStatementTest.java
rename to requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/LocalExceptionInStatementTest.java
index 370919f..2110462 100644
--- a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/LocalExceptionInStatementTest.java
+++ b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/LocalExceptionInStatementTest.java
@@ -1,7 +1,7 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
-import br.com.concretesolutions.requestmatcher.LocalTestRequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.LocalTestRequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
//@RunWith(RobolectricTestRunner.class)
//@Config(constants = BuildConfig.class, sdk = 23)
diff --git a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/LocalExceptionWitouhtEnqueuesTest.java b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/LocalExceptionWitouhtEnqueuesTest.java
similarity index 53%
rename from requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/LocalExceptionWitouhtEnqueuesTest.java
rename to requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/LocalExceptionWitouhtEnqueuesTest.java
index fd9e1dc..f852467 100644
--- a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/LocalExceptionWitouhtEnqueuesTest.java
+++ b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/LocalExceptionWitouhtEnqueuesTest.java
@@ -1,7 +1,7 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
-import br.com.concretesolutions.requestmatcher.LocalTestRequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.LocalTestRequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
public class LocalExceptionWitouhtEnqueuesTest extends ExceptionWitouhtEnqueuesTest {
diff --git a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/LocalRequestMatcherRuleTest.java b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/LocalRequestMatcherRuleTest.java
similarity index 52%
rename from requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/LocalRequestMatcherRuleTest.java
rename to requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/LocalRequestMatcherRuleTest.java
index 801e818..36e395b 100644
--- a/requestmatcher/src/test/java/br/com/concretesolutions/requestmatcher/test/LocalRequestMatcherRuleTest.java
+++ b/requestmatcher/src/test/java/br/com/concrete/requestmatcher/test/LocalRequestMatcherRuleTest.java
@@ -1,7 +1,7 @@
-package br.com.concretesolutions.requestmatcher.test;
+package br.com.concrete.requestmatcher.test;
-import br.com.concretesolutions.requestmatcher.LocalTestRequestMatcherRule;
-import br.com.concretesolutions.requestmatcher.RequestMatcherRule;
+import br.com.concrete.requestmatcher.LocalTestRequestMatcherRule;
+import br.com.concrete.requestmatcher.RequestMatcherRule;
public class LocalRequestMatcherRuleTest extends RequestMatcherRuleTest {
diff --git a/tools/linters.gradle b/tools/linters.gradle
index 9ea03d2..0bbb954 100644
--- a/tools/linters.gradle
+++ b/tools/linters.gradle
@@ -10,6 +10,10 @@ task checkstyle(type: Checkstyle) {
classpath = files()
}
+checkstyle {
+ toolVersion = '8.3'
+}
+
task pmd(type: Pmd) {
ruleSetFiles = files("${rootDir}/tools/linters/pmd-ruleset.xml")
ruleSets = []
@@ -26,4 +30,8 @@ task pmd(type: Pmd) {
}
}
+pmd {
+ toolVersion = '5.8.1'
+}
+
check.dependsOn 'checkstyle', 'pmd'
\ No newline at end of file