Expand my Community achievements bar.

SOLVED

Junit for mutifield test case

Avatar

Level 5

Hi all,

Can anyone suggest some Junits 5 blog for creating test case for below code

@inject
@Via("resource")
@Named("multifield/.")
private List<Multi> multifields;

@Override
public List<Multi> getMultifields() {
    return multifields;
}

 

Thanks in Advance

Nandheswara

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
3 Replies

Avatar

Level 4

Firstly, create a empty list of multi type, Then mock a multi object and add it in list.

Call the method appropriately.

 

 

Thanks

Shivam

Avatar

Community Advisor

@Nandheswara Create a dummy multifield json based resource using WCM AEM Context.

Avatar

Correct answer by
Community Advisor