Search in sources :

Example 1 with InstanceRepository

use of de.codecentric.boot.admin.server.domain.entities.InstanceRepository in project spring-boot-admin by codecentric.

the class LetsChatNotifierTest method setUp.

@BeforeEach
public void setUp() {
    InstanceRepository repository = mock(InstanceRepository.class);
    when(repository.find(instance.getId())).thenReturn(Mono.just(instance));
    restTemplate = mock(RestTemplate.class);
    notifier = new LetsChatNotifier(repository, restTemplate);
    notifier.setUsername(user);
    notifier.setUrl(URI.create(host));
    notifier.setRoom(room);
    notifier.setToken(token);
}
Also used : RestTemplate(org.springframework.web.client.RestTemplate) InstanceRepository(de.codecentric.boot.admin.server.domain.entities.InstanceRepository) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with InstanceRepository

use of de.codecentric.boot.admin.server.domain.entities.InstanceRepository 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)

Aggregations

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