Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gofeatureflag): fix java.lang.NoClassDefFoundError #839

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import java.util.concurrent.TimeUnit;

import static dev.openfeature.sdk.Value.objectToValue;
import static org.apache.hc.core5.http.ContentType.APPLICATION_JSON;


/**
* GoFeatureFlagController is the layer to contact the APIs and get the data
Expand All @@ -54,6 +54,7 @@
@Slf4j
@SuppressWarnings({"checkstyle:NoFinalizer"})
public class GoFeatureFlagController {
public static final String APPLICATION_JSON = "application/json";
public static final ObjectMapper requestMapper = new ObjectMapper();
private static final ObjectMapper responseMapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Expand Down Expand Up @@ -136,7 +137,7 @@ public <T> EvaluationResponse<T> evaluateFlag(

Request.Builder reqBuilder = new Request.Builder()
.url(url)
.addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON.getMimeType())
.addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON)
.post(RequestBody.create(
requestMapper.writeValueAsBytes(goffRequest),
MediaType.get("application/json; charset=utf-8")));
Expand Down Expand Up @@ -215,7 +216,7 @@ public void sendEventToDataCollector(List<Event> eventsList) {

Request.Builder reqBuilder = new Request.Builder()
.url(url)
.addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON.getMimeType())
.addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON)
.post(RequestBody.create(
requestMapper.writeValueAsBytes(events),
MediaType.get("application/json; charset=utf-8")));
Expand Down Expand Up @@ -258,7 +259,7 @@ public ConfigurationChange configurationHasChanged() throws GoFeatureFlagExcepti

Request.Builder reqBuilder = new Request.Builder()
.url(url)
.addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON.getMimeType())
.addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON)
.get();

if (this.etag != null && !this.etag.isEmpty()) {
Expand Down