Skip to content

Conversation

@IlyaMuravjov
Copy link
Collaborator

Description

Integration tests can't be generated when there are no beans for tested class, so we display an error.

How to test

Manual tests

Generate integration tests for AnimalService.getInjectedName() in TwoAnimals project using DolphinConfig, the following error should be reported, because DolphinConfig doesn't have any bean for AnimalService:

public void testGetInjectedName_errors() {
    // Couldn't generate some tests. List of errors:
    // 
    // 1 occurrences of:
    /* No beans of type org.example.service.AnimalService are found. Try choosing different
    Spring configuration or adding beans to org.example.DolphinConfig */

}

Self-check list

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@IlyaMuravjov IlyaMuravjov added ctg-enhancement New feature, improvement or change request comp-spring Issue is related to Spring projects support labels Jul 11, 2023
@EgorkaKulikov EgorkaKulikov merged commit 01c55b9 into main Jul 11, 2023
@EgorkaKulikov EgorkaKulikov deleted the ilya_m/no_beans_ut_error branch July 11, 2023 14:37
@alisevych alisevych added this to the Spring July stabilization milestone Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-spring Issue is related to Spring projects support ctg-enhancement New feature, improvement or change request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants