R027 - Missing beans when creating Spring context: 1

user-20231204T161640.log (25.0 KB)
@petersear please find the log file it says Partial tests written: 1

@Jane_Walls I can see the cover is not able to write tets if the method has parameters inside it for example -->MyCollectionSearchDao.encapView(CollectionMasterVo) like this it shows error Diffblue AI was unable to find a test: 1

Hi @Namrata_Devhare
From the log file I can see in the following lines that there’s no output for the Spring profile.

R027: Missing beans when creating Spring context Failed to create Spring context due to missing beans in the current Spring profile:

This is likely the reason why Cover cannot create Spring context for the MyCollectionSearchDao.loadOlfactoryList method.
Therefore, I would recommend check your Spring profile configuration, and ensure that you have declared the necessary profiles to Cover - refer to this guide on Spring profiles in our documentation for more help: Spring Configuration Options

Regarding your second point; in the MyCollectionSearchDao.encapView(CollectionMasterVo) method where you see “Diffblue AI was unable to find a test” - there will be more information in the support-.log file. If you upload this we can see the output code, which corresponds with a reason for this behaviour.

user-20231201T000122.log (53.2 KB)
support.log (124.4 KB)

@Aydar please check the below userlog and support log . It will be a greate pleasure if you resolve my errors as soon as possible

user-20231205T093252.log (422.0 KB)
support.log (460.7 KB)
for methods with parameters ,

what should i add here?

Hi @Namrata_Devhare

Thank you for uploading the support .log file. I can see that we time out while trying to load your context, I need to have a deeper look into your log file.

Regarding the screenshot above. This is where to specify the Spring profile in Intellij. For more context, as Java projects pass from development into production it is sometimes necessary to use different suits of project dependencies and settings, loaded as a profile. This is a Spring concept: see Spring documentation here.

hey @Aydar anything on this? Cover was unable to write any tests for the reasons listed below.
Change what sort of tests Cover writes in Change Settings.
Methods without tests: 1
support.log (994.2 KB)
user-20231206T151555.log (26.8 KB)

Hi @Namrata_Devhare
We’ve taken a look at the .log files you provided. It is likely the reason you get a partial test, rather than a full test is that the class is very big and complex. When Cover tries to instantiate the objects, it ends up timing out on methods com.keva.action.MyCollectionSearchAction.view and com.keva.service.MyCollectionSearchService.viewCollection
Therefore, I would recommend one of 2 options;

  1. Complete the class with the partial test Cover used
  2. Split up the class to be less complex, and so becomes much easier to test (for a human, or for Diffblue Cover)
1 Like