@Test
public void validateShouldThrowExceptionWhenConnectorNameIsNull() {

    //given
    ConnectorDefinition connectorDefinition = new ConnectorDefinition();
    connectorDefinition.setName(null);
    //when
    Throwable throwable = catchThrowable(
            () -> connectorDefinitionService.validate(Collections.singletonList(connectorDefinition))
    );
    //then
    assertThat(throwable)
            .isInstanceOf(IllegalStateException.class)
            .hasMessage("connectorDefinition name cannot be null or empty");
}