JAVA-31141:- Fix spring-cloud-eureka-feign-client-integration-test - ServiceDiscoveryBooksClientLiveTest (#16407)
This commit is contained in:
parent
1f2c8a5c3d
commit
f36ab6c06b
|
@ -79,7 +79,7 @@
|
|||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>testcontainers</artifactId>
|
||||
<version>1.14.3</version>
|
||||
<version>${testcontainers.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -108,6 +108,7 @@
|
|||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<wiremock.version>3.3.1</wiremock.version>
|
||||
<junit-jupiter.version>5.10.2</junit-jupiter.version>
|
||||
<testcontainers.version>1.17.3</testcontainers.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -24,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
@EnableConfigurationProperties
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@ContextConfiguration(classes = { MockBookServiceConfig.class }, initializers = { EurekaContainerConfig.Initializer.class })
|
||||
@ContextConfiguration(classes = { MockBookServiceConfig.class })
|
||||
class ServiceDiscoveryBooksClientLiveTest {
|
||||
|
||||
@Autowired
|
||||
|
@ -39,6 +39,11 @@ class ServiceDiscoveryBooksClientLiveTest {
|
|||
await().atMost(60, SECONDS).until(() -> eurekaClient.getApplications().size() > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Please ensure that Eureka is running on port , 8761 for this test to pass.
|
||||
* The EurekaServerApplication.main in spring-cloud-eureka-server project can be
|
||||
* run to make an Eureka Server available.
|
||||
*/
|
||||
@Test
|
||||
public void whenGetBooks_thenTheCorrectBooksAreReturned() {
|
||||
List<Book> books = booksClient.getBooks();
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
spring:
|
||||
application:
|
||||
name: books-service
|
||||
|
||||
eureka:
|
||||
client:
|
||||
serviceUrl:
|
||||
defaultZone: ${EUREKA_URI:http://localhost:8761/eureka}
|
||||
|
|
Loading…
Reference in New Issue