@Override
    public boolean validateTree(ValidationContext validationContext) {
        validate(validationContext);
        return (onCancelConfig.validateTree(validationContext) && errors.isEmpty() && !configuration.hasErrors());
    }
@Test
    public void validateTreeShouldVerifyIfConfigurationHasErrors() {
        Configuration configuration = mock(Configuration.class);

        PluggableTask pluggableTask = new PluggableTask(new PluginConfiguration(), configuration);

        when(configuration.hasErrors()).thenReturn(true);

        assertFalse(pluggableTask.validateTree(null));
    }