@Override
    protected void validateDataImpl(TenantId tenantId, Edge edge) {
        validateString("Edge name", edge.getName());
        validateString("Edge type", edge.getType());
        if (StringUtils.isEmpty(edge.getSecret())) {
            throw new DataValidationException("Edge secret should be specified!");
        }
        if (StringUtils.isEmpty(edge.getRoutingKey())) {
            throw new DataValidationException("Edge routing key should be specified!");
        }
        if (edge.getTenantId() == null) {
            throw new DataValidationException("Edge should be assigned to tenant!");
        } else {
            if (!tenantService.tenantExists(edge.getTenantId())) {
                throw new DataValidationException("Edge is referencing to non-existent tenant!");
            }
        }
        if (edge.getCustomerId() == null) {
            edge.setCustomerId(new CustomerId(NULL_UUID));
        } else if (!edge.getCustomerId().getId().equals(NULL_UUID)) {
            Customer customer = customerDao.findById(edge.getTenantId(), edge.getCustomerId().getId());
            if (customer == null) {
                throw new DataValidationException("Can't assign edge to non-existent customer!");
            }
            if (!customer.getTenantId().getId().equals(edge.getTenantId().getId())) {
                throw new DataValidationException("Can't assign edge to customer from different tenant!");
            }
        }
    }
@Test
    void testValidateNameInvocation() {
        Edge edge = new Edge();
        edge.setName("Edge 007");
        edge.setType("Silos");
        edge.setSecret("secret");
        edge.setRoutingKey("53c56104-d302-4d6e-97f5-a7a99c7effdc");
        edge.setTenantId(tenantId);

        validator.validateDataImpl(tenantId, edge);
        verify(validator).validateString("Edge name", edge.getName());
        verify(validator).validateString("Edge type", edge.getType());
    }