use of de.codecentric.boot.admin.event.ClientApplicationEvent in project spring-boot-admin by codecentric.
the class MailNotifierTest method test_onApplicationEvent_throw_doesnt_propagate.
@Test
public void test_onApplicationEvent_throw_doesnt_propagate() {
Notifier notifier = new AbstractStatusChangeNotifier() {
@Override
protected void doNotify(ClientApplicationEvent event) throws Exception {
throw new IllegalStateException("test");
}
};
notifier.notify(new ClientApplicationStatusChangedEvent(Application.create("App").withId("-id-").withHealthUrl("http://health").build(), StatusInfo.ofOffline(), StatusInfo.ofUp()));
}
use of de.codecentric.boot.admin.event.ClientApplicationEvent in project spring-boot-admin by codecentric.
the class HazelcastJournaledEventStoreTest method setup.
@Before
public void setup() {
HazelcastInstance hazelcast = HazelcastInstanceFactory.newHazelcastInstance(new Config());
store = new HazelcastJournaledEventStore(hazelcast.<ClientApplicationEvent>getList("testList"));
}
use of de.codecentric.boot.admin.event.ClientApplicationEvent in project spring-boot-admin by codecentric.
the class JournalControllerTest method test_getJournal.
@Test
public void test_getJournal() throws Exception {
ClientApplicationEvent emittedEvent = new ClientApplicationRegisteredEvent(Application.create("foo").withId("bar").withHealthUrl("http://health").build());
journal.onClientApplicationEvent(emittedEvent);
mvc.perform(get("/api/journal").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk()).andExpect(jsonPath("$[0].type").value("REGISTRATION"));
mvc.perform(get("/api/journal").accept(MediaType.parseMediaType("text/event-stream"))).andExpect(status().isOk());
}
Aggregations