java.lang.AssertionError: Formatted notes should not be null

hello community,
iam facing this error while creating tests for public void getNotesAsString_shouldReturnFormattedNotes()
The error java.lang.AssertionError: Formatted notes should not be null indicates that the getNotesAsString() method is returning null when it shouldn’t. Based on the trace, this is happening

any idea and suggestions would greatly help !

@rahul6603 @mherman22 @Moses_Mutesasira

1 Like

Have you tried debugging the code? for example adding this line System.out.println("persisted sample" + persistedSample) below this line Sample persistedSample = sampleService.getSampleByAccessionNumber(accessionNumber);

2 Likes

yes try to print it out in the console and see then take a look at the logic or data base see if its stored usually it might not be store and if thyou’re using different inherrent services to feed into what your testing you might as well do the same debug for those too to see which one is actually failing to insert data and why

3 Likes

to be more specific, iam still facing this issue
i have written this method and i have added some System.out.printlnto trace the errors in this way.
but i keep getting this error in evry test i have written
somehow i reallythink its about retrieving the note from the Db i still cant figure out how to make this work logically !
This is my whole suite
@mherman22 @Moses_Mutesasira