diff --git a/plugin/src/test/java/org/opensearch/ml/stats/MLModelStatsTests.java b/plugin/src/test/java/org/opensearch/ml/stats/MLModelStatsTests.java index f202441edd..a38ccfde51 100644 --- a/plugin/src/test/java/org/opensearch/ml/stats/MLModelStatsTests.java +++ b/plugin/src/test/java/org/opensearch/ml/stats/MLModelStatsTests.java @@ -51,6 +51,15 @@ public void testSerializationDeserialization() throws IOException { assertEquals(failureCount, parsedMLActionStats.getActionStat(ML_ACTION_FAILURE_COUNT)); } + public void testEmptySerializationDeserialization() throws IOException { + + Map modelStats = new HashMap<>(); + MLModelStats mlModelEmptyStats = new MLModelStats(modelStats); + BytesStreamOutput output = new BytesStreamOutput(); + mlModelEmptyStats.writeTo(output); + assertEquals(0, output.bytes().length()); + } + public void testToXContent() throws IOException { XContentBuilder builder = XContentBuilder.builder(XContentType.JSON.xContent()); builder.startObject();