Search in sources :

Example 1 with InMemoryEventStore

use of de.codecentric.boot.admin.server.eventstore.InMemoryEventStore in project spring-boot-admin by codecentric.

the class InstanceRegistryTest method setUp.

@BeforeEach
public void setUp() {
    repository = new EventsourcingInstanceRepository(new InMemoryEventStore());
    idGenerator = new HashingInstanceUrlIdGenerator();
    registry = new InstanceRegistry(repository, idGenerator);
}
Also used : InMemoryEventStore(de.codecentric.boot.admin.server.eventstore.InMemoryEventStore) EventsourcingInstanceRepository(de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with InMemoryEventStore

use of de.codecentric.boot.admin.server.eventstore.InMemoryEventStore in project spring-boot-admin by codecentric.

the class InstanceDiscoveryListenerTest method setup.

@BeforeEach
public void setup() {
    this.discovery = mock(DiscoveryClient.class);
    InstanceRepository repository = new EventsourcingInstanceRepository(new InMemoryEventStore());
    this.registry = spy(new InstanceRegistry(repository, new HashingInstanceUrlIdGenerator()));
    this.listener = new InstanceDiscoveryListener(this.discovery, this.registry, repository);
}
Also used : InstanceRegistry(de.codecentric.boot.admin.server.services.InstanceRegistry) HashingInstanceUrlIdGenerator(de.codecentric.boot.admin.server.services.HashingInstanceUrlIdGenerator) InMemoryEventStore(de.codecentric.boot.admin.server.eventstore.InMemoryEventStore) EventsourcingInstanceRepository(de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository) DiscoveryClient(org.springframework.cloud.client.discovery.DiscoveryClient) EventsourcingInstanceRepository(de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository) InstanceRepository(de.codecentric.boot.admin.server.domain.entities.InstanceRepository) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with InMemoryEventStore

use of de.codecentric.boot.admin.server.eventstore.InMemoryEventStore in project spring-boot-admin by codecentric.

the class EndpointDetectorTest method setup.

@BeforeEach
public void setup() {
    eventStore = new InMemoryEventStore();
    repository = new EventsourcingInstanceRepository(eventStore);
    strategy = mock(EndpointDetectionStrategy.class);
    detector = new EndpointDetector(repository, strategy);
}
Also used : InMemoryEventStore(de.codecentric.boot.admin.server.eventstore.InMemoryEventStore) EventsourcingInstanceRepository(de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository) EndpointDetectionStrategy(de.codecentric.boot.admin.server.services.endpoints.EndpointDetectionStrategy) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with InMemoryEventStore

use of de.codecentric.boot.admin.server.eventstore.InMemoryEventStore in project spring-boot-admin by codecentric.

the class InfoUpdaterTest method setup.

@BeforeEach
public void setup() {
    this.eventStore = new InMemoryEventStore();
    this.repository = new EventsourcingInstanceRepository(this.eventStore);
    this.updater = new InfoUpdater(this.repository, InstanceWebClient.builder().filter(rewriteEndpointUrl()).filter(retry(0, singletonMap(Endpoint.INFO, 1))).filter(timeout(Duration.ofSeconds(2), emptyMap())).build());
    this.wireMock.start();
}
Also used : InMemoryEventStore(de.codecentric.boot.admin.server.eventstore.InMemoryEventStore) EventsourcingInstanceRepository(de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 5 with InMemoryEventStore

use of de.codecentric.boot.admin.server.eventstore.InMemoryEventStore in project spring-boot-admin by codecentric.

the class StatusUpdaterTest method setup.

@BeforeEach
public void setup() {
    this.wireMock.start();
    this.eventStore = new InMemoryEventStore();
    this.repository = new EventsourcingInstanceRepository(this.eventStore);
    this.instance = Instance.create(InstanceId.of("id")).register(Registration.create("foo", this.wireMock.url("/health")).build());
    StepVerifier.create(this.repository.save(this.instance)).expectNextCount(1).verifyComplete();
    this.updater = new StatusUpdater(this.repository, InstanceWebClient.builder().filter(rewriteEndpointUrl()).filter(retry(0, singletonMap(Endpoint.HEALTH, 1))).filter(timeout(Duration.ofSeconds(2), emptyMap())).build());
}
Also used : InMemoryEventStore(de.codecentric.boot.admin.server.eventstore.InMemoryEventStore) EventsourcingInstanceRepository(de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

EventsourcingInstanceRepository (de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository)5 InMemoryEventStore (de.codecentric.boot.admin.server.eventstore.InMemoryEventStore)5 BeforeEach (org.junit.jupiter.api.BeforeEach)5 InstanceRepository (de.codecentric.boot.admin.server.domain.entities.InstanceRepository)1 HashingInstanceUrlIdGenerator (de.codecentric.boot.admin.server.services.HashingInstanceUrlIdGenerator)1 InstanceRegistry (de.codecentric.boot.admin.server.services.InstanceRegistry)1 EndpointDetectionStrategy (de.codecentric.boot.admin.server.services.endpoints.EndpointDetectionStrategy)1 DiscoveryClient (org.springframework.cloud.client.discovery.DiscoveryClient)1