I am facing an issue but I don't know what I'm doing wrong. I'm writing a test class for a code which has this 2 lines:
public static Blob getPkpass(){
// more code here...
List<ContentVersion> archivoLogo = [SELECT id, ContentDocument.Title, VersionData FROM ContentVersion WHERE ContentDocument.Title = 'logo@2x'];
List<ContentVersion> archivoIcon = [SELECT id, ContentDocument.Title, VersionData FROM ContentVersion WHERE ContentDocument.Title = 'icon@2x'];
// more code here...
}
The code is working fine but in the test class when this method is executed, I get this error in the list:
List index out of bounds: 0.
The query works perfectly outside the test class. I have also tried with @TestVisible
but I get the same result
What I'm doing wrong???