@Override
    protected void validateDataImpl(TenantId tenantId, Alarm alarm) {
        validateString("Alarm type", alarm.getType());
        if (alarm.getOriginator() == null) {
            throw new DataValidationException("Alarm originator should be specified!");
        }
        if (alarm.getSeverity() == null) {
            throw new DataValidationException("Alarm severity should be specified!");
        }
        if (alarm.getStatus() == null) {
            throw new DataValidationException("Alarm status should be specified!");
        }
        if (alarm.getTenantId() == null) {
            throw new DataValidationException("Alarm should be assigned to tenant!");
        } else {
            if (!tenantService.tenantExists(alarm.getTenantId())) {
                throw new DataValidationException("Alarm is referencing to non-existent tenant!");
            }
        }
    }
@Test
    void testValidateNameInvocation() {
        Alarm alarm = new Alarm();
        alarm.setType("overheating");
        alarm.setOriginator(tenantId);
        alarm.setSeverity(AlarmSeverity.CRITICAL);
        alarm.setCleared(false);
        alarm.setAcknowledged(false);
        alarm.setTenantId(tenantId);

        validator.validateDataImpl(tenantId, alarm);
        verify(validator).validateString("Alarm type", alarm.getType());
    }