From b35fc08fef356c3fa782dbed3ad6485235f1b23c Mon Sep 17 00:00:00 2001 From: Enrico Olivelli Date: Mon, 3 May 2021 12:52:29 +0200 Subject: [PATCH] fix test --- .../src/test/java/org/apache/pulsar/schema/SchemaTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java index a21f64d1835d0..078a056697a0b 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java @@ -460,9 +460,12 @@ private void testUseAutoConsumeWithSchemalessTopic(SchemaType schema) throws Exc if (schema == SchemaType.BYTES) { assertEquals(schema, message.getSchema().get().getSchemaInfo().getType()); assertEquals(schema, message2.getSchema().get().getSchemaInfo().getType()); + } else if (schema == SchemaType.NONE) { + // schema NONE is always reported as BYTES + assertEquals(SchemaType.BYTES, message.getSchema().get().getSchemaInfo().getType()); + assertEquals(SchemaType.BYTES, message2.getSchema().get().getSchemaInfo().getType()); } else { - assertFalse(message.getSchema().isPresent()); - assertEquals(schema, message2.getSchema().get().getSchemaInfo().getType()); + fail(); } assertEquals("foo".getBytes(StandardCharsets.UTF_8), message.getValue());