@Test public void testWriteNotRequiredMethodWithEmptyValue() throws IOException { TestClassWithStrings testClassWithStrings = new TestClassWithStrings(); testClassWithStrings.setS2(""); Buffer buffer = new Buffer(); JsonWriter writer = JsonWriter.of(buffer); JsonTelemetryDataSerializer tested = new JsonTelemetryDataSerializer(writer); testClassWithStrings.serialize(tested); tested.close(); writer.close(); String str = new String(buffer.readByteArray(), Charsets.UTF_8); Map<String, String> recoveryMap = new Gson().fromJson(str, new TypeToken<HashMap<String, String>>() {}.getType()); assertEquals("DEFAULT s1", recoveryMap.get("s1")); assertNull(recoveryMap.get("s2")); }
public void close() throws IOException { out.endObject(); }
JsonTelemetryDataSerializer { public void close() throws IOException { out.endObject(); } }
JsonTelemetryDataSerializer { public void close() throws IOException { out.endObject(); } JsonTelemetryDataSerializer(JsonWriter out); }
JsonTelemetryDataSerializer { public void close() throws IOException { out.endObject(); } JsonTelemetryDataSerializer(JsonWriter out); void reset(JsonWriter out); void close(); void write(String name, Duration value); void write(String name, DataPointType value); void write(String name, int value); void write(String name, com.microsoft.applicationinsights.internal.schemav2.SeverityLevel value); void write(String name, Integer value); void write(String name, double value); void write(String name, Double value); void write(String name, short value); void write(String name, Short value); void write(String name, long value); void write(String name, Long value); void write(String name, boolean value); void write(String name, Boolean value); void write(String name, Date value); void write(String name, String value, int len); void writeRequired(String name, String value, int len); void write(String name, T value); void write(String name, Map<String, T> map); void write(String name, List<T> list); }
JsonTelemetryDataSerializer { public void close() throws IOException { out.endObject(); } JsonTelemetryDataSerializer(JsonWriter out); void reset(JsonWriter out); void close(); void write(String name, Duration value); void write(String name, DataPointType value); void write(String name, int value); void write(String name, com.microsoft.applicationinsights.internal.schemav2.SeverityLevel value); void write(String name, Integer value); void write(String name, double value); void write(String name, Double value); void write(String name, short value); void write(String name, Short value); void write(String name, long value); void write(String name, Long value); void write(String name, boolean value); void write(String name, Boolean value); void write(String name, Date value); void write(String name, String value, int len); void writeRequired(String name, String value, int len); void write(String name, T value); void write(String name, Map<String, T> map); void write(String name, List<T> list);  }