Could not initialize class org.elasticsearch.common.xcontent.json.JsonXContent

While running the junits , we are facing the below issue and we are using ES2.3.1

java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.common.xcontent.json.JsonXContent
at org.elasticsearch.common.xcontent.XContentFactory.contentBuilder(XContentFactory.java:122)
at org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder(XContentFactory.java:49)
at org.elasticsearch.action.support.ToXContentToBytes.toString(ToXContentToBytes.java:73)
at java.lang.String.valueOf(String.java:2847)
at java.lang.StringBuilder.append(StringBuilder.java:128)
at com.XXX.searchservice.util.IPDQueryBuilderUtil.filterByAtaQuery(IPDQueryBuilderUtil.java:151)