@Test
public void testValidateValueMatchingType() {

    ConnectSchema.validateValue(Schema.INT8_SCHEMA, (byte) 1);
    ConnectSchema.validateValue(Schema.INT16_SCHEMA, (short) 1);
    ConnectSchema.validateValue(Schema.INT32_SCHEMA, 1);
    ConnectSchema.validateValue(Schema.INT64_SCHEMA, (long) 1);
    ConnectSchema.validateValue(Schema.FLOAT32_SCHEMA, 1.f);
    ConnectSchema.validateValue(Schema.FLOAT64_SCHEMA, 1.);
    ConnectSchema.validateValue(Schema.BOOLEAN_SCHEMA, true);
    ConnectSchema.validateValue(Schema.STRING_SCHEMA, "a string");
    ConnectSchema.validateValue(Schema.BYTES_SCHEMA, "a byte array".getBytes());
    ConnectSchema.validateValue(Schema.BYTES_SCHEMA, ByteBuffer.wrap("a byte array".getBytes()));
    ConnectSchema.validateValue(SchemaBuilder.array(Schema.INT32_SCHEMA).build(), Arrays.asList(1, 2, 3));
    ConnectSchema.validateValue(
            SchemaBuilder.map(Schema.INT32_SCHEMA, Schema.STRING_SCHEMA).build(),
            Collections.singletonMap(1, "value")
    );
    // Struct tests the basic struct layout + complex field types + nested structs
    Struct structValue = new Struct(STRUCT_SCHEMA)
            .put("first", 1)
            .put("second", "foo")
            .put("array", Arrays.asList(1, 2, 3))
            .put("map", Collections.singletonMap(1, "value"))
            .put("nested", new Struct(FLAT_STRUCT_SCHEMA).put("field", 12));
    ConnectSchema.validateValue(STRUCT_SCHEMA, structValue);
}