Updates to handle bootstrap or optional configserver import
This commit is contained in:
@@ -42,6 +42,10 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-config</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
spring:
|
||||
application:
|
||||
name: standalone
|
||||
config:
|
||||
import: "optional:configserver:"
|
||||
|
||||
server:
|
||||
port: 7777
|
||||
|
||||
@@ -4,8 +4,12 @@ spring:
|
||||
cloud:
|
||||
function:
|
||||
definition: you
|
||||
config:
|
||||
import: "optional:configserver:"
|
||||
---
|
||||
spring:
|
||||
profiles: other
|
||||
config:
|
||||
activate:
|
||||
on-profile: other
|
||||
server:
|
||||
port: 8081
|
||||
port: 8081
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.bus.BusBridge;
|
||||
import org.springframework.cloud.bus.event.Destination;
|
||||
import org.springframework.cloud.bus.event.RefreshRemoteApplicationEvent;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -27,9 +28,12 @@ public class StreamBusApplicationTests {
|
||||
@Autowired
|
||||
private MyListener myListener;
|
||||
|
||||
@Autowired
|
||||
private Destination.Factory factory;
|
||||
|
||||
@Test
|
||||
public void business() throws Exception {
|
||||
RefreshRemoteApplicationEvent event = new RefreshRemoteApplicationEvent(this, "me", "you");
|
||||
public void business() {
|
||||
RefreshRemoteApplicationEvent event = new RefreshRemoteApplicationEvent(this, "me", factory.getDestination("you"));
|
||||
this.bus.send(event);
|
||||
RefreshRemoteApplicationEvent event1 = myListener.refreshRemoteApplicationEvent;
|
||||
assertThat(event1).isEqualTo(event);
|
||||
|
||||
Reference in New Issue
Block a user