As of 2022-08-21, this repository is archived and no longer actively maintained. The last release is 1.0.8 which contains only version updates.
An embeddable Eureka server to be used for testing.
THIS SHOULD NOT BE USED IN PRODUCTION!!!
This version is based off of the v2 endpoints in Eureka.
- Add the Maven dependency (available in Maven Central)
<dependency>
<groupId>org.kiwiproject</groupId>
<artifactId>embedded-eureka</artifactId>
<version>[current-version]</version>
<scope>test</scope>
</dependency>
The extension can be added to a test class as follows:
import org.junit.jupiter.api.extension.RegisterExtension;
import org.kiwiproject.eureka.junit.EurekaServerExtension;
class ServiceTest {
@RegisterExtension
static final EurekaServerExtension EUREKA = new EurekaServerExtension();
// Test code goes here
}
You can then get the port from the extension to pass into your Eureka client.