@Test(expected = SerializationException.class)
public void testSerialize_invalidMetricData() {

    // The only reason we require a null key to throw a SerializationException here is that
    // MetricTank expects a non-null key, and this serde is a MetricTank serde. But in general
    // AA doesn't require a non-null key.
    val invalidMetricDef = new MetricDefinition((String) null);
    val invalidMetricData = new MetricData(invalidMetricDef, 0.0, Instant.now().getEpochSecond());
    serdeUnderTest.serializer().serialize("some-topic", invalidMetricData);
}