This repository has been archived by the owner on Feb 21, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Catalin Buleandra
committed
Feb 25, 2015
1 parent
6919908
commit 763bc54
Showing
7 changed files
with
53 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/test/groovy/com/ofg/uptodate/finder/HttpProxyServerProvider.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 15 additions & 2 deletions
17
src/test/groovy/com/ofg/uptodate/finder/JCenterReponseProvider.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
package com.ofg.uptodate.finder | ||
|
||
import com.github.tomakehurst.wiremock.client.MappingBuilder | ||
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder | ||
|
||
import static com.github.tomakehurst.wiremock.client.WireMock.* | ||
|
||
class JCenterReponseProvider { | ||
|
||
void stubInteractionForJcenter(String group, String name, String response) { | ||
stubInteraction(get(urlMatching("^.*${group.split('\\.').join('/')}/${name}/maven-metadata.xml")), aResponse().withHeader('content-type', 'application/xml').withStatus(200).withBody(response)) | ||
stubInteraction(jcenterMapping(group, name), jcenterResponse(response)) | ||
} | ||
|
||
void stubProxyInteractionForJcenter(String group, String name, String response) { | ||
stubProxyInteraction(get(urlMatching("^.*${group.split('\\.').join('/')}/${name}/maven-metadata.xml")), aResponse().withHeader('content-type', 'application/xml').withStatus(200).withBody(response)) | ||
stubProxyInteraction(jcenterMapping(group, name), jcenterResponse(response)) | ||
} | ||
|
||
private static MappingBuilder jcenterMapping(String group, String name) { | ||
return get(urlMatching("^.*${group.split('\\.').join('/')}/${name}/maven-metadata.xml")) | ||
} | ||
|
||
private static ResponseDefinitionBuilder jcenterResponse(String response) { | ||
return aResponse().withHeader('content-type', 'application/xml').withStatus(200).withBody(response) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters