diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/pom.xml new file mode 100644 index 0000000000..23e06a55f9 --- /dev/null +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + spring-cloud-eureka-client-profiles + 1.0.0-SNAPSHOT + spring-cloud-eureka-client-profiles + jar + Spring Cloud Eureka Sample Client + + + com.baeldung.spring.cloud + spring-cloud-eureka + 1.0.0-SNAPSHOT + + + + + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + + + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + org.springframework.boot + spring-boot-starter-web + + + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/java/com/baeldung/spring/cloud/eureka/client/EurekaClientApplication.java b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/java/com/baeldung/spring/cloud/eureka/client/EurekaClientApplication.java new file mode 100644 index 0000000000..854bab97e7 --- /dev/null +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/java/com/baeldung/spring/cloud/eureka/client/EurekaClientApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.spring.cloud.eureka.client; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class EurekaClientApplication { + + public static void main(String[] args) { + SpringApplication.run(EurekaClientApplication.class, args); + } + +} diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/java/com/baeldung/spring/cloud/eureka/client/controller/HelloWorldController.java b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/java/com/baeldung/spring/cloud/eureka/client/controller/HelloWorldController.java new file mode 100644 index 0000000000..d0d0a6ec9f --- /dev/null +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/java/com/baeldung/spring/cloud/eureka/client/controller/HelloWorldController.java @@ -0,0 +1,13 @@ +package com.baeldung.spring.cloud.eureka.client.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloWorldController { + + @RequestMapping("/hello") + public String hello() { + return "Hello World!"; + } +} diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/resources/application-dev.properties b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/resources/application-dev.properties new file mode 100644 index 0000000000..c565e42678 --- /dev/null +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/resources/application-dev.properties @@ -0,0 +1,2 @@ +server.port=8080 +spring.cloud.discovery.enabled=false \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/resources/application.properties b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/resources/application.properties new file mode 100644 index 0000000000..3cfecbbf08 --- /dev/null +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/main/resources/application.properties @@ -0,0 +1,9 @@ +server.port=8080 + +eureka.client.serviceUrl.defaultZone=${EUREKA_URI:http://localhost:8761/eureka} +eureka.instance.preferIpAddress=false + +spring.application.name=spring-cloud-eureka-client +#--- +spring.config.activate.on-profile=dev +spring.cloud.discovery.enabled=false \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/test/java/com/baeldung/spring/cloud/eureka/client/SpringContextTest.java b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/test/java/com/baeldung/spring/cloud/eureka/client/SpringContextTest.java new file mode 100644 index 0000000000..a3ed012abb --- /dev/null +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client-profiles/src/test/java/com/baeldung/spring/cloud/eureka/client/SpringContextTest.java @@ -0,0 +1,16 @@ +package com.baeldung.spring.cloud.eureka.client; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class SpringContextTest { + + @Test + public void whenSpringContextIsBootstrapped_thenNoExceptions() { + } + +}