Unverified Commit c2b9510a authored by sknirmalkar89's avatar sknirmalkar89 Committed by GitHub
Browse files

SB-28414:Certification notification job failing due utf-8 encoding issue (#1035)

* SB-28414:Certification notification job failing due utf-8 encoding issue fix

* SB-28414:Certification notification job failing due utf-8 encoding issue fix
Showing with 4 additions and 4 deletions
+4 -4
......@@ -14,6 +14,7 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPatch;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ConnectionKeepAliveStrategy;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
......@@ -99,7 +100,7 @@ public class HttpClientUtil {
httpPost.addHeader(entry.getKey(), entry.getValue());
}
}
StringEntity entity = new StringEntity(params);
StringEntity entity = new StringEntity(params,ContentType.APPLICATION_JSON);
httpPost.setEntity(entity);
response = httpclient.execute(httpPost);
......@@ -154,7 +155,7 @@ public class HttpClientUtil {
httpPatch.addHeader(entry.getKey(), entry.getValue());
}
}
StringEntity entity = new StringEntity(params);
StringEntity entity = new StringEntity(params, ContentType.APPLICATION_JSON);
httpPatch.setEntity(entity);
response = httpclient.execute(httpPatch);
......
......@@ -2,6 +2,7 @@ package org.sunbird.client;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.codec.binary.StringUtils;
import org.sunbird.exception.ProjectCommonException;
import org.sunbird.exception.ResponseCode;
import org.sunbird.http.HttpClientUtil;
......@@ -33,7 +34,6 @@ public class NotificationServiceClient {
private String getJsonString(Request req) throws JsonProcessingException {
String json = mapper.writeValueAsString(req);
json = new String(json.getBytes(), StandardCharsets.UTF_8);
return json;
}
......
......@@ -15,7 +15,6 @@ import org.sunbird.operations.ActorOperations;
public class SSUUserCreateActorTest extends UserManagementActorTestBase {
public final Props props = Props.create(SSUUserCreateActor.class);
@Test
public void testCreateUserV3Failure() {
Organisation organisation = new Organisation();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment