Merge branch '1.1.x'

This commit is contained in:
Marcin Grzejszczak
2017-07-05 12:48:17 +02:00
2 changed files with 7 additions and 5 deletions

View File

@@ -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() {

View File

@@ -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) {