Java Code Examples for de.codecentric.boot.admin.server.domain.entities.Instance#getId()
The following examples show how to use
de.codecentric.boot.admin.server.domain.entities.Instance#getId() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InstanceNameNotificationFilterTest.java From Moss with Apache License 2.0 | 6 votes |
@Test public void test_filterByName() { NotificationFilter filter = new ApplicationNameNotificationFilter("foo", null); Instance filteredInstance = Instance.create(InstanceId.of("-")) .register(Registration.create("foo", "http://health").build()); InstanceRegisteredEvent filteredEvent = new InstanceRegisteredEvent(filteredInstance.getId(), filteredInstance.getVersion(), filteredInstance.getRegistration()); assertThat(filter.filter(filteredEvent, filteredInstance)).isTrue(); Instance ignoredInstance = Instance.create(InstanceId.of("-")) .register(Registration.create("bar", "http://health").build()); InstanceRegisteredEvent ignoredEvent = new InstanceRegisteredEvent(ignoredInstance.getId(), ignoredInstance.getVersion(), ignoredInstance.getRegistration()); assertThat(filter.filter(ignoredEvent, ignoredInstance)).isFalse(); }
Example 2
Source File: InstanceIdNotificationFilterTest.java From Moss with Apache License 2.0 | 6 votes |
@Test public void test_filterByName() { NotificationFilter filter = new InstanceIdNotificationFilter(InstanceId.of("cafebabe"), null); Instance filteredInstance = Instance.create(InstanceId.of("cafebabe")) .register(Registration.create("foo", "http://health").build()); InstanceRegisteredEvent filteredEvent = new InstanceRegisteredEvent(filteredInstance.getId(), filteredInstance.getVersion(), filteredInstance.getRegistration()); assertThat(filter.filter(filteredEvent, filteredInstance)).isTrue(); Instance ignoredInstance = Instance.create(InstanceId.of("-")) .register(Registration.create("foo", "http://health").build()); InstanceRegisteredEvent ignoredEvent = new InstanceRegisteredEvent(ignoredInstance.getId(), ignoredInstance.getVersion(), ignoredInstance.getRegistration()); assertThat(filter.filter(ignoredEvent, ignoredInstance)).isFalse(); }
Example 3
Source File: InstanceNameNotificationFilterTest.java From spring-boot-admin with Apache License 2.0 | 6 votes |
@Test public void test_filterByName() { NotificationFilter filter = new ApplicationNameNotificationFilter("foo", null); Instance filteredInstance = Instance.create(InstanceId.of("-")) .register(Registration.create("foo", "http://health").build()); InstanceRegisteredEvent filteredEvent = new InstanceRegisteredEvent(filteredInstance.getId(), filteredInstance.getVersion(), filteredInstance.getRegistration()); assertThat(filter.filter(filteredEvent, filteredInstance)).isTrue(); Instance ignoredInstance = Instance.create(InstanceId.of("-")) .register(Registration.create("bar", "http://health").build()); InstanceRegisteredEvent ignoredEvent = new InstanceRegisteredEvent(ignoredInstance.getId(), ignoredInstance.getVersion(), ignoredInstance.getRegistration()); assertThat(filter.filter(ignoredEvent, ignoredInstance)).isFalse(); }
Example 4
Source File: InstanceIdNotificationFilterTest.java From spring-boot-admin with Apache License 2.0 | 6 votes |
@Test public void test_filterByName() { NotificationFilter filter = new InstanceIdNotificationFilter(InstanceId.of("cafebabe"), null); Instance filteredInstance = Instance.create(InstanceId.of("cafebabe")) .register(Registration.create("foo", "http://health").build()); InstanceRegisteredEvent filteredEvent = new InstanceRegisteredEvent(filteredInstance.getId(), filteredInstance.getVersion(), filteredInstance.getRegistration()); assertThat(filter.filter(filteredEvent, filteredInstance)).isTrue(); Instance ignoredInstance = Instance.create(InstanceId.of("-")) .register(Registration.create("foo", "http://health").build()); InstanceRegisteredEvent ignoredEvent = new InstanceRegisteredEvent(ignoredInstance.getId(), ignoredInstance.getVersion(), ignoredInstance.getRegistration()); assertThat(filter.filter(ignoredEvent, ignoredInstance)).isFalse(); }
Example 5
Source File: ApplicationRegistryTest.java From spring-boot-admin with Apache License 2.0 | 5 votes |
@Test public void deregister() { Instance instance1 = getInstance("App1"); InstanceId instance1Id = instance1.getId(); when(this.instanceRegistry.getInstances("App1")).thenReturn(Flux.just(instance1)); when(this.instanceRegistry.deregister(instance1Id)).thenReturn(Mono.just(instance1Id)); StepVerifier.create(this.applicationRegistry.deregister("App1")) .assertNext((instanceId) -> assertThat(instanceId).isEqualTo(instance1Id)).verifyComplete(); verify(this.instanceRegistry).deregister(instance1Id); }
Example 6
Source File: OpsGenieNotifier.java From Moss with Apache License 2.0 | 4 votes |
protected String generateAlias(Instance instance) { return instance.getRegistration().getName() + "_" + instance.getId(); }
Example 7
Source File: OpsGenieNotifier.java From spring-boot-admin with Apache License 2.0 | 4 votes |
protected String generateAlias(Instance instance) { return instance.getRegistration().getName() + "_" + instance.getId(); }