Hi All,
I am getting this error for Stringutils method while debugging junit. Am i missing anything?
ava.lang.NoSuchMethodError: 'boolean org.apache.commons.lang3.StringUtils.isNoneBlank(java.lang.CharSequence[])'
Solved! Go to Solution.
Views
Replies
Total Likes
As mentioned by @Imran__Khan , you might not be using the correct java api.
you can use the StringUtils.isNotBlank method, which is available with all the apis
@archana_r This line is written as part of which file, test class or the class for which we are writing junit.
Here's your problem: commons-lang-2.6.jar doesn't contain the org.apache.commons.lang3 package, since that's part of version 3, and commons-lang3-3.1-sources.jar contains the source code, not the byte code.
You need to include commons-lang3-3.1.jar instead.
Refer below link for more info
https://stackoverflow.com/questions/28504174/noclassdeffounderror-org-apache-commons-lang3-stringuti...s
I am invoking an util class from my test class. The util class has this
StringUtils.isNoneBlank(path)method.
Is there anything, we need add in Junit test class while invkoing?
@Imran__Khan Interestingly changing ito
StringUtils.isNotEmpty(path)
has not thrown any error. This issue is only seen while executing junit test cases.
StringUtils.isNotEmpty(path) will fail for null, instead use StringUtils.isNotBlank(path)
As mentioned by @Imran__Khan , you might not be using the correct java api.
you can use the StringUtils.isNotBlank method, which is available with all the apis
Views
Like
Replies