Some minor changes based on feedback
This commit is contained in:
1
pom.xml
1
pom.xml
@@ -63,6 +63,7 @@
|
||||
<jacoco-maven-plugin.version>0.8.4</jacoco-maven-plugin.version>
|
||||
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
|
||||
<InMemoryJavaCompiler.version>1.3.0</InMemoryJavaCompiler.version>
|
||||
<kotlin.version>1.3.41</kotlin.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
== Prerequisites
|
||||
|
||||
First you have to publish to Maven Local the stubs of the *http-server* module
|
||||
First, you have to publish to Maven Local the stubs of the *http-server* module.
|
||||
|
||||
== How to run it?
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class TestController {
|
||||
if (!Arrays.equals(this.request, requestBody)) {
|
||||
throw IllegalStateException("Invalid request body");
|
||||
}
|
||||
return this.response;
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
package org.springframework.cloud.contract.spec.internal;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Contains Http Methods.
|
||||
*
|
||||
@@ -25,6 +28,13 @@ package org.springframework.cloud.contract.spec.internal;
|
||||
*/
|
||||
public final class HttpMethods {
|
||||
|
||||
private static final Log log = LogFactory.getLog(HttpMethods.class);
|
||||
|
||||
public HttpMethods() {
|
||||
log.warn(
|
||||
"WARNING: HttpMethods shouldn't be instantiated. Use its static methods instead.");
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code GET} method.
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
package org.springframework.cloud.contract.spec.internal;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Helper functions for HTTP statuses.
|
||||
*
|
||||
@@ -25,6 +28,13 @@ package org.springframework.cloud.contract.spec.internal;
|
||||
*/
|
||||
public final class HttpStatus {
|
||||
|
||||
private static final Log log = LogFactory.getLog(HttpStatus.class);
|
||||
|
||||
public HttpStatus() {
|
||||
log.warn(
|
||||
"WARNING: HttpStatus shouldn't be instantiated. Use its static methods instead.");
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code 100 Continue} status code.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.2.1">HTTP/1.1:
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
package org.springframework.cloud.contract.spec.internal;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Contains most commonly used media types.
|
||||
*
|
||||
@@ -25,6 +28,13 @@ package org.springframework.cloud.contract.spec.internal;
|
||||
*/
|
||||
public class MediaTypes {
|
||||
|
||||
private static final Log log = LogFactory.getLog(MediaTypes.class);
|
||||
|
||||
public MediaTypes() {
|
||||
log.warn(
|
||||
"WARNING: MediaTypes shouldn't be instantiated. Use its static methods instead.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Public constant for that includes all media ranges (i.e. "*/*").
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
package org.springframework.cloud.contract.spec.internal;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Contains most commonly used messaging headers.
|
||||
*
|
||||
@@ -25,6 +28,13 @@ package org.springframework.cloud.contract.spec.internal;
|
||||
*/
|
||||
public class MessagingHeaders {
|
||||
|
||||
private static final Log log = LogFactory.getLog(MessagingHeaders.class);
|
||||
|
||||
public MessagingHeaders() {
|
||||
log.warn(
|
||||
"WARNING: MessagingHeaders shouldn't be instantiated. Use its static methods instead.");
|
||||
}
|
||||
|
||||
/**
|
||||
* The Content-Type header name of a message.
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,9 @@ import java.util.Arrays;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Contains most common regular expression patterns.
|
||||
*
|
||||
@@ -29,8 +32,11 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public final class RegexPatterns {
|
||||
|
||||
private static final Log log = LogFactory.getLog(RegexPatterns.class);
|
||||
|
||||
public RegexPatterns() {
|
||||
System.out.println("WARNING: RegexPatterns shouldn't be instantiated");
|
||||
log.warn(
|
||||
"WARNING: RegexPatterns shouldn't be instantiated. Use its static methods instead.");
|
||||
}
|
||||
|
||||
protected static final Pattern TRUE_OR_FALSE = Pattern.compile("(true|false)");
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* @author Tim Ysewyn
|
||||
*/
|
||||
public class HttpHeadersTests {
|
||||
class HttpHeadersTests {
|
||||
|
||||
@Test
|
||||
public void ACCEPT() {
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* @author Tim Ysewyn
|
||||
*/
|
||||
public class HttpMethodsTests {
|
||||
class HttpMethodsTests {
|
||||
|
||||
@Test
|
||||
public void GET() {
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
|
||||
/**
|
||||
* @author Tim Ysewyn
|
||||
*/
|
||||
public class MediaTypesTests {
|
||||
class MediaTypesTests {
|
||||
|
||||
@Test
|
||||
public void ALL_VALUE() {
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
<kotlin.version>1.3.41</kotlin.version>
|
||||
</properties>
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-parent</artifactId>
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
package org.springframework.cloud.contract.spec.internal
|
||||
|
||||
/**
|
||||
* Marker to narrow the scope inside the lamda.
|
||||
* @author Tim Ysewyn
|
||||
* @since 2.2.0
|
||||
*/
|
||||
@DslMarker
|
||||
annotation class ContractDslMarker
|
||||
@@ -52,7 +52,7 @@ class FromRequestDsl {
|
||||
fun path() = FromRequestDslProperty(template.escapedPath())
|
||||
|
||||
/**
|
||||
* nth value of a URL path (zero indexed) e.g. {{{ request.path.[2] }}}* @param index.
|
||||
* nth value of a URL path (zero indexed) e.g. {{{ request.path.[2] }}}*.
|
||||
* @param index path index
|
||||
* @return dsl property
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.io.File
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class KotlinContractConverterTest {
|
||||
class KotlinContractConverterTests {
|
||||
|
||||
@Test
|
||||
fun `accept kts files`() {
|
||||
Reference in New Issue
Block a user