Search in sources :

Example 1 with EventType

use of net.nemerosa.ontrack.model.events.EventType in project ontrack by nemerosa.

the class EventFactoryTest method custom_event_type.

@Test
public void custom_event_type() {
    EventFactory factory = new EventFactoryImpl();
    factory.register(SimpleEventType.of("custom-type", "My custom event type"));
    EventType eventType = factory.toEventType("custom-type");
    assertEquals("custom-type", eventType.getId());
    assertEquals("My custom event type", eventType.getTemplate());
}
Also used : SimpleEventType(net.nemerosa.ontrack.model.events.SimpleEventType) EventType(net.nemerosa.ontrack.model.events.EventType) EventFactory(net.nemerosa.ontrack.model.events.EventFactory) Test(org.junit.Test)

Example 2 with EventType

use of net.nemerosa.ontrack.model.events.EventType in project ontrack by nemerosa.

the class ConfigurationPropertyCleanupListener method onEvent.

@Override
public void onEvent(Event event) {
    // For configuration being deleted
    EventType eventType = event.getEventType();
    if (eventType == EventFactory.DELETE_CONFIGURATION) {
        String configurationName = event.getValue("configuration");
        cleanup(configurationName);
    }
}
Also used : EventType(net.nemerosa.ontrack.model.events.EventType)

Aggregations

EventType (net.nemerosa.ontrack.model.events.EventType)2 EventFactory (net.nemerosa.ontrack.model.events.EventFactory)1 SimpleEventType (net.nemerosa.ontrack.model.events.SimpleEventType)1 Test (org.junit.Test)1