File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
products/feature-flagging/lib/src
main/java/com/datadog/featureflag
test/groovy/com/datadog/featureflag Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1616import datadog .trace .api .featureflag .ufc .v1 .ServerConfiguration ;
1717import java .io .ByteArrayInputStream ;
1818import java .io .IOException ;
19- import java .io .UnsupportedEncodingException ;
2019import java .time .Instant ;
2120import java .time .ZoneOffset ;
2221import java .time .format .DateTimeFormatter ;
@@ -100,7 +99,7 @@ public Date fromJson(@Nonnull final JsonReader reader) throws IOException {
10099 @ Override
101100 public void toJson (@ Nonnull final JsonWriter writer , @ Nullable final Date value )
102101 throws IOException {
103- throw new UnsupportedEncodingException ("Reading only adapter" );
102+ throw new UnsupportedOperationException ("Reading only adapter" );
104103 }
105104 }
106105}
Original file line number Diff line number Diff line change 11package com.datadog.featureflag
22
33import com.squareup.moshi.JsonReader
4+ import com.squareup.moshi.JsonWriter
45import datadog.communication.ddagent.SharedCommunicationObjects
56import datadog.remoteconfig.Capabilities
67import datadog.remoteconfig.ConfigurationDeserializer
@@ -105,4 +106,15 @@ class RemoteConfigServiceTest extends DDSpecification {
105106 // Null input
106107 null | null
107108 }
109+
110+ void ' test parsing only adapter' () {
111+ given :
112+ final adapter = new RemoteConfigServiceImpl.DateAdapter ()
113+
114+ when :
115+ adapter. toJson(Stub (JsonWriter ), new Date ())
116+
117+ then :
118+ thrown(UnsupportedOperationException )
119+ }
108120}
You can’t perform that action at this time.
0 commit comments