Skip to content

Commit

Permalink
Fix the gradle plugun to work with scala 2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Oct 2, 2014
1 parent be586bb commit 6165b71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PactVerificationTask extends DefaultTask {
throw new RuntimeException('You must specify the pactfile to execute (use pactFile = ...)')
}

def interactions = JavaConverters$.MODULE$.asJavaIteratorConverter(pact.interactions().iterator())
def interactions = JavaConverters$.MODULE$.seqAsJavaListConverter(pact.interactions())
interactions.asJava().each { Interaction interaction ->
def interactionMessage = "Verifying a pact between ${consumer.name} and ${providerToVerify.name} - ${interaction.description()}"

Expand Down Expand Up @@ -143,7 +143,7 @@ class PactVerificationTask extends DefaultTask {
void displayHeadersResult(Map failures, def expected, Map comparison, String comparisonDescription) {
if (!comparison.isEmpty()) {
AnsiConsole.out().println(' includes headers')
Map expectedHeaders = JavaConverters$.MODULE$.asJavaMapConverter(expected.get()).asJava()
Map expectedHeaders = JavaConverters$.MODULE$.mapAsJavaMapConverter(expected.get()).asJava()
comparison.each { key, headerComparison ->
def expectedHeaderValue = expectedHeaders[key]
def ansi = Ansi.ansi().a(' "').bold().a(key).boldOff().a('" with value "').bold()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ProviderClient {
def requestMap = [path: request.path()]
requestMap.headers = [:]
if (request.headers().defined) {
requestMap.headers = JavaConverters$.MODULE$.asJavaMapConverter(request.headers().get()).asJava()
requestMap.headers = JavaConverters$.MODULE$.mapAsJavaMapConverter(request.headers().get()).asJava()
}

if (requestMap.headers['Content-Type']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ class ResponseComparison {
Map headerResult = [:]

if (expected.headers().defined) {
def headers
if (JavaConverters$.MODULE$.metaClass.respondsTo('asJavaMapConverter')) {
headers = JavaConverters$.MODULE$.asJavaMapConverter(expected.headers().get()).asJava()
} else {
headers = JavaConverters$.MODULE$.mapAsJavaMapConverter(expected.headers().get()).asJava()
}
def headers = JavaConverters$.MODULE$.mapAsJavaMapConverter(expected.headers().get()).asJava()
headers.each { headerKey, value ->
try {
assert actualHeaders[headerKey.toUpperCase()] == value
Expand Down

0 comments on commit 6165b71

Please sign in to comment.