#159 - Polishing.
Encapsulate dependency versions in DependencyVersions value object. Use ModuleIteration instead of TrainIteration+Project.
This commit is contained in:
@@ -23,6 +23,7 @@ import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -31,6 +32,7 @@ import org.springframework.data.release.AbstractIntegrationTests;
|
||||
import org.springframework.data.release.git.GitOperations;
|
||||
import org.springframework.data.release.model.Iteration;
|
||||
import org.springframework.data.release.model.Projects;
|
||||
import org.springframework.data.release.model.ReleaseTrains;
|
||||
|
||||
/**
|
||||
* Integration tests for {@link DependencyOperations}.
|
||||
@@ -55,6 +57,11 @@ class DependencyOperationsIntegrationTests extends AbstractIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
git.checkout(ReleaseTrains.MOORE);
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldDiscoverDependencyVersions() {
|
||||
assertThat(operations.getAvailableVersions(Dependencies.PROJECT_REACTOR)).isNotEmpty();
|
||||
@@ -62,17 +69,15 @@ class DependencyOperationsIntegrationTests extends AbstractIntegrationTests {
|
||||
|
||||
@Test
|
||||
void shouldReportExistingDependencyVersions() {
|
||||
assertThat(operations.getCurrentDependencies(Projects.BUILD)).isNotEmpty();
|
||||
assertThat(operations.getCurrentDependencies(Projects.BUILD).isEmpty()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldReportExistingOptionalDependencies() {
|
||||
|
||||
// git.checkout(ReleaseTrains.MOORE);
|
||||
|
||||
assertThat(operations.getCurrentDependencies(Projects.CASSANDRA)).hasSize(1);
|
||||
assertThat(operations.getCurrentDependencies(Projects.MONGO_DB)).hasSize(1);
|
||||
assertThat(operations.getCurrentDependencies(Projects.NEO4J)).hasSize(1);
|
||||
assertThat(operations.getCurrentDependencies(Projects.CASSANDRA).getVersions()).hasSize(1);
|
||||
assertThat(operations.getCurrentDependencies(Projects.MONGO_DB).getVersions()).hasSize(2);
|
||||
assertThat(operations.getCurrentDependencies(Projects.NEO4J).getVersions()).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -17,7 +17,6 @@ package org.springframework.data.release.dependency;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -40,9 +39,10 @@ class DependencyUpgradeProposalsUnitTests {
|
||||
properties.put("dependency.iteration", "M1");
|
||||
properties.put("dependency[org.assertj:assertj-core]", "3.18.1");
|
||||
|
||||
Map<Dependency, DependencyVersion> dependencies = DependencyUpgradeProposals
|
||||
DependencyVersions dependencies = DependencyUpgradeProposals
|
||||
.fromProperties(ReleaseTrains.PASCAL.getIteration(Iteration.M1), properties);
|
||||
|
||||
assertThat(dependencies).hasSize(1).containsEntry(Dependencies.ASSERTJ, DependencyVersion.of("3.18.1"));
|
||||
assertThat(dependencies.getVersions()).hasSize(1).containsEntry(Dependencies.ASSERTJ,
|
||||
DependencyVersion.of("3.18.1"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ class JiraConnectorIntegrationTests extends AbstractIntegrationTests {
|
||||
mockService.stubFor(put(urlPathMatching("/rest/api/2/issue/DATAREDIS-302")).//
|
||||
willReturn(aResponse().withStatus(204)));
|
||||
|
||||
jira.assignTicketToMe(new Ticket("DATAREDIS-302", "", null, null));
|
||||
jira.assignTicketToMe(Projects.REDIS, new Ticket("DATAREDIS-302", "", null, null));
|
||||
|
||||
verify(putRequestedFor(urlPathMatching("/rest/api/2/issue/DATAREDIS-302")).withRequestBody(equalToJson(
|
||||
"{\"update\":{\"assignee\":[ {\"set\":{\"name\":\"dummy\"}} ] }, \"transition\":{}, \"fields\":{}}")));
|
||||
@@ -271,7 +271,7 @@ class JiraConnectorIntegrationTests extends AbstractIntegrationTests {
|
||||
mockService.stubFor(post(urlPathMatching("/rest/api/2/issue/DATACASS-302")).//
|
||||
willReturn(aResponse().withStatus(204)));
|
||||
|
||||
jira.assignTicketToMe(new Ticket("DATACASS-302", "", null, null));
|
||||
jira.assignTicketToMe(Projects.CASSANDRA, new Ticket("DATACASS-302", "", null, null));
|
||||
|
||||
verify(0, postRequestedFor(urlPathMatching("/rest/api/2/issue/DATACASS-302")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user