|
|
|
@ -29,6 +29,7 @@ import com.google.gson.Gson;
|
|
|
|
|
import com.google.gson.GsonBuilder;
|
|
|
|
|
import com.google.gson.LongSerializationPolicy;
|
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
import org.skyscreamer.jsonassert.JSONAssert;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
|
|
|
|
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
|
|
|
@ -150,7 +151,7 @@ class GsonAutoConfigurationTests {
|
|
|
|
|
void customGsonBuilder() {
|
|
|
|
|
this.contextRunner.withUserConfiguration(GsonBuilderConfig.class).run((context) -> {
|
|
|
|
|
Gson gson = context.getBean(Gson.class);
|
|
|
|
|
assertThat(gson.toJson(new DataObject())).isEqualTo("{\"data\":1,\"owner\":null}");
|
|
|
|
|
JSONAssert.assertEquals(gson.toJson(new DataObject()), "{\"data\":1,\"owner\":null}", false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|