Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions kubernetes/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ java_library(
srcs = glob(["src/main/java/**/*.java"]),
visibility = ["//visibility:public"],
deps = [
"@maven//:com_fasterxml_jackson_core_jackson_annotations",
"@maven//:com_fasterxml_jackson_core_jackson_core",
"@maven//:com_fasterxml_jackson_core_jackson_databind",
"@maven//:com_google_code_gson_gson",
"@maven//:com_squareup_okhttp3_logging_interceptor",
"@maven//:com_squareup_okhttp3_okhttp_jvm",
Expand All @@ -28,8 +25,6 @@ java_test_suite(
runner = "junit5",
deps = [
":client-java-api",
"@maven//:com_fasterxml_jackson_core_jackson_core",
"@maven//:com_fasterxml_jackson_core_jackson_databind",
"@maven//:com_google_code_gson_gson",
"@maven//:com_squareup_okhttp3_okhttp_jvm",
"@maven//:com_squareup_okio_okio_jvm",
Expand Down
4 changes: 0 additions & 4 deletions kubernetes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>io.gsonfire</groupId>
<artifactId>gson-fire</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package io.kubernetes.client.custom;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
Expand All @@ -22,7 +21,6 @@
import java.util.Objects;

@JsonAdapter(IntOrString.IntOrStringAdapter.class)
@JsonSerialize(using = IntOrStringJacksonSerializer.class)
public class IntOrString {
private final boolean isInt;
private final String strValue;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.kubernetes.client.openapi.JSON;
import org.junit.jupiter.api.Test;

// Note: Do not use AssertJ .isEquqlTo to test .equals, as this doesn't necessarily invoke it!
Expand Down Expand Up @@ -116,12 +115,14 @@ void whenCreatedWithString_notEqualAnotherWithDifferentValue() {
}

@Test
void jacksonSerializer_writeValueAsString() throws JsonProcessingException {
IntOrString intOrString1 = new IntOrString(17);
IntOrString intOrString2 = new IntOrString("17");
void gsonAdapter_serializesAsIntOrString() {
assertThat(JSON.getGson().toJson(new IntOrString(17))).isEqualTo("17");
assertThat(JSON.getGson().toJson(new IntOrString("17"))).isEqualTo("\"17\"");
}

ObjectMapper mapper = new ObjectMapper();
mapper.writeValueAsString(intOrString1);
mapper.writeValueAsString(intOrString2);
@Test
void gsonAdapter_deserializesAsIntOrString() {
assertThat(JSON.getGson().fromJson("17", IntOrString.class).getIntValue()).isEqualTo(17);
assertThat(JSON.getGson().fromJson("\"17\"", IntOrString.class).getStrValue()).isEqualTo("17");
}
}
Loading