Skip to content

Commit 0a11f80

Browse files
Removed deprecations (#2307)
- removed some unused methods and parameters - removed one, deprecated kotlin DSL method - removed Gradle plugin reading src/test/resources/contracts folder Signed-off-by: marcin <[email protected]>
1 parent 632a3ef commit 0a11f80

File tree

7 files changed

+6
-31
lines changed

7 files changed

+6
-31
lines changed

specs/spring-cloud-contract-spec-kotlin/src/main/kotlin/org/springframework/cloud/contract/spec/internal/ResponseDsl.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ class ResponseDsl : CommonDsl() {
7171

7272
fun fixedMilliseconds(delay: Int): DslProperty<Any> = delay.toDslProperty()
7373

74-
/**
75-
* @deprecated Use the {@link #fixedMilliseconds(int) fixedMilliseconds} method.
76-
*/
77-
fun fixedMilliseconds(delay: Long): DslProperty<Any> = fixedMilliseconds(delay.toInt())
78-
7974
fun headers(headers: HeadersDsl.() -> Unit) {
8075
this.headers = ResponseHeadersDsl().apply(headers).get()
8176
}

specs/spring-cloud-contract-spec-kotlin/src/test/kotlin/org/springframework/cloud/contract/spec/ContractTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ then:
781781
}
782782
}
783783
response {
784-
delay = fixedMilliseconds(1000L)
784+
delay = fixedMilliseconds(1000)
785785
status = OK
786786
body = body(
787787
listOf(

spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/StubRepository.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,6 @@ public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IO
136136
return mappingDescriptors;
137137
}
138138

139-
private ContractConverter contractConverter(File file) {
140-
for (ContractConverter converter : this.contractConverters) {
141-
if (converter.isAccepted(file)) {
142-
return converter;
143-
}
144-
}
145-
return null;
146-
}
147-
148139
private boolean httpServerStubAccepts(File file) {
149140
for (HttpServerStub httpServerStub : this.httpServerStubs) {
150141
if (httpServerStub.isAccepted(file)) {

spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/AbstractGitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ File createNewFile(File project) throws Exception {
6161
return newFile;
6262
}
6363

64-
void setOriginOnProjectToTmp(File origin, File project, boolean push)
64+
void setOriginOnProjectToTmp(File origin, File project)
6565
throws GitAPIException, IOException, URISyntaxException {
6666
try (Git git = openGitProject(project)) {
6767
RemoteRemoveCommand remove = git.remoteRemove();

spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/ContractProjectUpdaterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void setup() throws Exception {
5959
this.origin = clonedProject(this.tmp.newFolder(), this.originalProject);
6060
this.project = this.gitRepo.cloneProject(this.originalProject.toURI());
6161
this.gitRepo.checkout(this.project, "master");
62-
setOriginOnProjectToTmp(this.origin, this.project, true);
62+
setOriginOnProjectToTmp(this.origin, this.project);
6363
StubRunnerOptions options = new StubRunnerOptionsBuilder()
6464
.withStubRepositoryRoot("file://" + this.project.getAbsolutePath() + "/")
6565
.withStubsMode(StubRunnerProperties.StubsMode.REMOTE)

spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/GitRepoTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void should_not_commit_empty_changes() throws Exception {
133133
public void should_push_changes_to_current_branch() throws Exception {
134134
File origin = clonedProject(this.tmp.newFolder(), this.project);
135135
File project = this.gitRepo.cloneProject(this.project.toURI());
136-
setOriginOnProjectToTmp(origin, project, true);
136+
setOriginOnProjectToTmp(origin, project);
137137
createNewFile(project);
138138
this.gitRepo.commit(project, "some message");
139139

@@ -149,7 +149,7 @@ public void should_push_changes_to_current_branch() throws Exception {
149149
public void should_pull_changes_to_current_branch() throws Exception {
150150
File origin = clonedProject(this.tmp.newFolder(), this.project);
151151
File project = this.gitRepo.cloneProject(this.project.toURI());
152-
setOriginOnProjectToTmp(origin, project, false);
152+
setOriginOnProjectToTmp(origin, project);
153153
createNewFile(origin);
154154
this.gitRepo.commit(origin, "some message");
155155

spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -383,18 +383,7 @@ private TaskProvider<ContractsCopyTask> registerCopyContractsTask(ContractVerifi
383383
if (contractsDslDir.getAsFile().exists()) {
384384
return contractsDslDir;
385385
}
386-
else {
387-
Directory legacyContractsDslDir = layout.getProjectDirectory()
388-
.dir("src/test/resources/contracts");
389-
if (legacyContractsDslDir.getAsFile().exists()) {
390-
logger.warn(
391-
"Spring Cloud Contract Verifier Plugin: Locating contracts in <src/test/resources/contracts> has been removed. Please move them to <src/contractTest/resources/contracts>. This warning message will be removed in a future release.");
392-
return contractsDslDir;
393-
}
394-
else {
395-
return null;
396-
}
397-
}
386+
return null;
398387
});
399388
}));
400389
contractsCopyTask.getContractDependency().getGroupId()

0 commit comments

Comments
 (0)