-
Notifications
You must be signed in to change notification settings - Fork 45
Closed as not planned
Labels
comp-sarifIssue is related to SARIF report or Problems tabIssue is related to SARIF report or Problems tabcomp-springIssue is related to Spring projects supportIssue is related to Spring projects supportctg-bugIssue is a bugIssue is a bug
Milestone
Description
Description
StackOverflowError is shown on Problems view for NamedEntity when generating tests for VisitController
To Reproduce
- Run the 'spring-petclinic' project in IntelliJ Idea 2023.1
- Use plugin to generate tests with following settings (other can be default):
- Spring: No configuration
- Mock everything outside the class
- Do not mock static methods
- Wait Problems view is opened
- Select error for NamedEntity
- Click "View generated test"
- Run it
Expected behavior
No tests for NamedEntity are expected. Neither errors on Problems view.
Tests shown on Problems view should fail with expected exception.
Actual behavior
The test doesn't throw exception.
Visual proofs (screenshots, logs, images)
The following test method in VisitControllerTest s addressed
///region OTHER: ERROR SUITE for method loadPetWithVisit(int, int, java.util.Map)
@Test(expected = StackOverflowError.class)
public void testLoadPetWithVisit1() {
(when(ownerMock.getPet(any(Integer.class)))).thenReturn(petMock);
(when(ownerRepositoryMock.findById(any()))).thenReturn(ownerMock);
LinkedHashMap model = new LinkedHashMap();
visitController.loadPetWithVisit(0, 0, model);
}
///endregionEnvironment
Windows 10 Pro
IntelliJ IDEA 2023.1 Ultimate
Metadata
Metadata
Assignees
Labels
comp-sarifIssue is related to SARIF report or Problems tabIssue is related to SARIF report or Problems tabcomp-springIssue is related to Spring projects supportIssue is related to Spring projects supportctg-bugIssue is a bugIssue is a bug
Type
Projects
Status
Done

