Correctness - Method encodes String bytes without specifying the character encoding

Code smell is thrown when

 byte[] byteResponse = clientResponse.getPayload();
String jsonString=new String(byteResponse);
  • Solution
  • mention the encoding while creating the string from the byte response
 String jsonString=new String(byteResponse,StandardCharsets.UTF_8);