Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to write the JUnit

Ronnie09
Level 4
Level 4

For the below code I am unable to write the JUnit for @Postconstruct init()

 

But for text JUNIT is working fine via JSON. Need help

@inject
private Page currentPage;

@ValueMapValue
Private String text;

private String pageTitle;
@PostConstruct
protected void init() {
    if(!(currentPage.getName().equalsIgnoreCase("Product") || currentPage.getTemplate.getPath.equals("/conf/we-retail/settings/wcm/templates/hero")))
   {
       text="";
    }
}

public void getText()
{ return text;}

 

2 Replies