


Hi ! I'm trying to create a test case JUnit which involves getting the title metadata from image. But so far I can't find any materials or samples of Assets DAM JUnit test cases. Any suggestions will be helpful. Thank you
Views
Replies
Total Likes
Could you give the sample code you are trying to test ? Basically the logic of unit testing is mocking everything you want to test. If you have the correct mocks created , your test should basically pass.
@Veena_Vikram please see below
public String getImageTitle() {
Resource resource = resolver.getResource(imagePath);
Asset asset = resource.adaptTo(Asset.class);
return asset.getMetadataValue("dc:Title");
}