Merge branch '1.1.x'
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package org.springframework.cloud.contract.stubrunner;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Downloads a JAR with contracts and sets up the plugin configuration with proper
|
||||
* inclusion patterns
|
||||
@@ -88,7 +88,7 @@ public class ContractDownloader {
|
||||
|
||||
private String wrapWithAntPattern(String path) {
|
||||
String changedPath = path.replace(File.separator, "/");
|
||||
return "**" + surroundWithSeparator(changedPath) + "**/";
|
||||
return "**" + surroundWithSeparator(changedPath).replace(File.separator, "/") + "**/";
|
||||
}
|
||||
|
||||
private File unpackAndDownloadContracts() {
|
||||
|
||||
@@ -26,6 +26,7 @@ class ContractDownloaderSpec extends Specification {
|
||||
properties.includedContracts.startsWith('^')
|
||||
properties.includedContracts.endsWith('$')
|
||||
properties.includedContracts.contains(fileSeparated('/some/path/to/somewhere(/)?.*/a/b/c/d/.*'))
|
||||
properties.includedRootFolderAntPattern == "**/a/b/c/d/**/"
|
||||
}
|
||||
|
||||
def 'should set inclusion pattern on config when path pattern was explicitly provided without a separator at the beginning'() {
|
||||
@@ -42,6 +43,7 @@ class ContractDownloaderSpec extends Specification {
|
||||
properties.includedContracts.startsWith('^')
|
||||
properties.includedContracts.endsWith('$')
|
||||
properties.includedContracts.contains(fileSeparated('/some/path/to/somewhere(/)?.*/a/b/c/d/.*'))
|
||||
properties.includedRootFolderAntPattern == "**/a/b/c/d/**/"
|
||||
}
|
||||
|
||||
private static String fileSeparated(String string) {
|
||||
|
||||
Reference in New Issue
Block a user