Fix name of artifact in dsl test

This commit is contained in:
Dave Syer
2016-07-26 17:51:04 +01:00
parent f7e4e036bd
commit 4e21cbd884
6 changed files with 18 additions and 19 deletions

View File

@@ -1 +1 @@
rootProject.name = 'http-client'
rootProject.name = 'http-client-dsl'

View File

@@ -22,7 +22,7 @@ public class LoanApplicationServiceTests {
// end::autoconfigure_stubrunner[]
@Autowired
private LoanApplicationService sut;
private LoanApplicationService service;
@Test
public void shouldSuccessfullyApplyForLoan() {
@@ -30,7 +30,7 @@ public class LoanApplicationServiceTests {
LoanApplication application = new LoanApplication(new Client("1234567890"),
123.123);
// when:
LoanApplicationResult loanApplication = sut.loanApplication(application);
LoanApplicationResult loanApplication = service.loanApplication(application);
// then:
assertThat(loanApplication.getLoanApplicationStatus())
.isEqualTo(LoanApplicationStatus.LOAN_APPLIED);
@@ -44,7 +44,7 @@ public class LoanApplicationServiceTests {
LoanApplication application = new LoanApplication(new Client("1234567890"),
99999);
// when:
LoanApplicationResult loanApplication = sut.loanApplication(application);
LoanApplicationResult loanApplication = service.loanApplication(application);
// then:
assertThat(loanApplication.getLoanApplicationStatus())
.isEqualTo(LoanApplicationStatus.LOAN_APPLICATION_REJECTED);

View File

@@ -1,3 +1,3 @@
stubrunner.stubs:
ids: 'com.example:http-server:+:stubs:8080'
ids: 'com.example:http-server-dsl:+:stubs:8080'
repositoryRoot: http://repo.spring.io/libs-snapshot

View File

@@ -1 +1 @@
rootProject.name = 'http-server'
rootProject.name = 'http-server-dsl'

View File

@@ -29,7 +29,7 @@ public class BatchStubRunnerFactory {
private final StubRunnerOptions stubRunnerOptions;
private final StubDownloader stubDownloader;
private final MessageVerifier contractVerifierMessaging;
private final MessageVerifier<?> contractVerifierMessaging;
public BatchStubRunnerFactory(StubRunnerOptions stubRunnerOptions) {
this(stubRunnerOptions, new AetherStubDownloader(stubRunnerOptions), new NoOpStubMessages());
@@ -39,7 +39,7 @@ public class BatchStubRunnerFactory {
this(stubRunnerOptions, stubDownloader, new NoOpStubMessages());
}
public BatchStubRunnerFactory(StubRunnerOptions stubRunnerOptions, StubDownloader stubDownloader, MessageVerifier contractVerifierMessaging) {
public BatchStubRunnerFactory(StubRunnerOptions stubRunnerOptions, StubDownloader stubDownloader, MessageVerifier<?> contractVerifierMessaging) {
this.stubRunnerOptions = stubRunnerOptions;
this.stubDownloader = stubDownloader;
this.contractVerifierMessaging = contractVerifierMessaging;

View File

@@ -38,11 +38,10 @@ import com.netflix.loadbalancer.ServerList;
*
* @since 1.0.0
*/
class StubRunnerRibbonServerList implements ServerList {
class StubRunnerRibbonServerList implements ServerList<Server> {
private final ServerList<?> serverList;
private final ServerList<Server> serverList;
@SuppressWarnings("unchecked")
StubRunnerRibbonServerList(final StubFinder stubFinder,
final StubMapperProperties stubMapperProperties,
final IClientConfig clientConfig,
@@ -53,7 +52,7 @@ class StubRunnerRibbonServerList implements ServerList {
stubMapperProperties.fromServiceIdToIvyNotation(serviceName) : serviceName;
RunningStubs runningStubs = stubFinder.findAllRunningStubs();
final Map.Entry<StubConfiguration, Integer> entry = runningStubs.getEntry(mappedServiceName);
final Collection servers = new ArrayList<>();
final Collection<Server> servers = new ArrayList<>();
if (entry != null) {
servers.add(new Server("localhost", entry.getValue()) {
@Override
@@ -82,18 +81,18 @@ class StubRunnerRibbonServerList implements ServerList {
}
});
}
serverList = new ServerList() {
serverList = new ServerList<Server>() {
@Override
public List<?> getInitialListOfServers() {
List combinedList = new ArrayList<>();
public List<Server> getInitialListOfServers() {
List<Server> combinedList = new ArrayList<>();
combinedList.addAll(servers);
combinedList.addAll(delegate.getInitialListOfServers());
return combinedList;
}
@Override
public List<?> getUpdatedListOfServers() {
List combinedList = new ArrayList<>();
public List<Server> getUpdatedListOfServers() {
List<Server> combinedList = new ArrayList<>();
combinedList.addAll(servers);
combinedList.addAll(delegate.getUpdatedListOfServers());
return combinedList;
@@ -102,12 +101,12 @@ class StubRunnerRibbonServerList implements ServerList {
}
@Override
public List<?> getInitialListOfServers() {
public List<Server> getInitialListOfServers() {
return serverList.getInitialListOfServers();
}
@Override
public List<?> getUpdatedListOfServers() {
public List<Server> getUpdatedListOfServers() {
return serverList.getUpdatedListOfServers();
}
}