Search in sources :

Example 1 with SystemStatusChangedEventDto

use of org.eclipse.che.api.system.shared.dto.SystemStatusChangedEventDto in project che by eclipse.

the class DtoConverterTest method convertsSystemStatusChangedEvent.

@Test
public void convertsSystemStatusChangedEvent() {
    SystemStatusChangedEvent event = new SystemStatusChangedEvent(RUNNING, PREPARING_TO_SHUTDOWN);
    SystemStatusChangedEventDto dto = DtoConverter.asDto(event);
    assertEquals(dto.getType(), EventType.STATUS_CHANGED);
    assertEquals(dto.getPrevStatus(), event.getPrevStatus());
    assertEquals(dto.getStatus(), event.getStatus());
}
Also used : SystemStatusChangedEvent(org.eclipse.che.api.system.shared.event.SystemStatusChangedEvent) SystemStatusChangedEventDto(org.eclipse.che.api.system.shared.dto.SystemStatusChangedEventDto) Test(org.testng.annotations.Test)

Example 2 with SystemStatusChangedEventDto

use of org.eclipse.che.api.system.shared.dto.SystemStatusChangedEventDto in project che by eclipse.

the class DtoConverter method asDto.

/**
     * Creates {@link SystemStatusChangedEventDto} from event.
     */
public static SystemStatusChangedEventDto asDto(SystemStatusChangedEvent event) {
    SystemStatusChangedEventDto dto = DtoFactory.newDto(SystemStatusChangedEventDto.class);
    dto.setType(event.getType());
    dto.setStatus(event.getStatus());
    dto.setPrevStatus(event.getPrevStatus());
    return dto;
}
Also used : SystemStatusChangedEventDto(org.eclipse.che.api.system.shared.dto.SystemStatusChangedEventDto)

Aggregations

SystemStatusChangedEventDto (org.eclipse.che.api.system.shared.dto.SystemStatusChangedEventDto)2 SystemStatusChangedEvent (org.eclipse.che.api.system.shared.event.SystemStatusChangedEvent)1 Test (org.testng.annotations.Test)1