cancel
Showing results for 
Search instead for 
Did you mean: 

JUnit for lambda expression and method references

02-05-2019 3:19 PM
293 views 0 comments
0 Likes
SAP Managed Tags
Subscribe

Hi Experts,

Please see below code.

 if (languageLocale == null)
         {
             localizedPopulator.populate((locale, value) -> {
                 if (StringUtils.isNotEmpty(value))
                 {
                     nameList.add(Utils.createLocalizedData(localizedPopulator.getLanguage(locale), value));
                 }
             }, source::getName); }

Any pointers on how can we cover this piece of code with JUnit? I tried couple of ways yet could not come up to a solution. Can anyone help here?

0 Likes

Accepted Solutions (0)

Answers (0)