Code review comment: 1. They are equal? We may only need to declare just one `plainDecimalJson`? 2. Please move the variable near where it is used.

Code under review:
public void testSerializationDecimalEncode() throws Exception {
        String original =
                "{\"decimal1\":123.456789,\"decimal2\":454621864049246170,\"decimal3\":0.000000027}";
        String expectedWithPlainDecimal =
                "{\"decimal1\":123.456789,\"decimal2\":454621864049246170,\"decimal3\":0.000000027}";
        String expectedWithoutPlainDecimal =
                "{\"decimal1\":123.456789,\"decimal2\":4.5462186404924617E+17,\"decimal3\":2.7E-8}";

        RowType schema =
                (RowType)
                        ROW(
                                        FIELD("decimal1", DECIMAL(9, 6)),
                                        FIELD("decimal2", DECIMAL(20, 0)),
                                        FIELD("decimal3", DECIMAL(11, 9)))
                                .getLogicalType();

        TypeInformation<RowData> resultTypeInfo = InternalTypeInfo.of(schema);

        JsonRowDataDeserializationSchema deserializationSchema =
                new JsonRowDataDeserializationSchema(
                        schema, resultTypeInfo, false, false, TimestampFormat.ISO_8601);

        JsonRowDataSerializationSchema serializationSchemaWithPlainDecimal =
                new JsonRowDataSerializationSchema(
                        schema,
                        TimestampFormat.ISO_8601,
                        JsonOptions.MapNullKeyMode.LITERAL,
                        "null",
                        true);
        JsonRowDataSerializationSchema serializationSchemaWithoutPlainDecimal =
                new JsonRowDataSerializationSchema(
                        schema,
                        TimestampFormat.ISO_8601,
                        JsonOptions.MapNullKeyMode.LITERAL,
                        "null",
                        false);

        RowData rowData = deserializationSchema.deserialize(original.getBytes());

        String resultWithPlainDecimal =
                new String(serializationSchemaWithPlainDecimal.serialize(rowData));
        assertEquals(expectedWithPlainDecimal, resultWithPlainDecimal);

        String resultWithoutPlainDecimal =
                new String(serializationSchemaWithoutPlainDecimal.serialize(rowData));
        assertEquals(expectedWithoutPlainDecimal, resultWithoutPlainDecimal);
    }

Line commented on: "{\"decimal1\":123.456789,\"decimal2\":454621864049246170,\"decimal3\":0.000000027}";

Revised code:
public void testSerializationDecimalEncode() throws Exception {
        RowType schema =
                (RowType)
                        ROW(
                                        FIELD("decimal1", DECIMAL(9, 6)),
                                        FIELD("decimal2", DECIMAL(20, 0)),
                                        FIELD("decimal3", DECIMAL(11, 9)))
                                .getLogicalType();

        TypeInformation<RowData> resultTypeInfo = InternalTypeInfo.of(schema);

        JsonRowDataDeserializationSchema deserializer =
                new JsonRowDataDeserializationSchema(
                        schema, resultTypeInfo, false, false, TimestampFormat.ISO_8601);

        JsonRowDataSerializationSchema plainDecimalSerializer =
                new JsonRowDataSerializationSchema(
                        schema,
                        TimestampFormat.ISO_8601,
                        JsonOptions.MapNullKeyMode.LITERAL,
                        "null",
                        true);
        JsonRowDataSerializationSchema scientificDecimalSerializer =
                new JsonRowDataSerializationSchema(
                        schema,
                        TimestampFormat.ISO_8601,
                        JsonOptions.MapNullKeyMode.LITERAL,
                        "null",
                        false);

        String plainDecimalJson =
                "{\"decimal1\":123.456789,\"decimal2\":454621864049246170,\"decimal3\":0.000000027}";
        RowData rowData = deserializer.deserialize(plainDecimalJson.getBytes());

        String plainDecimalResult = new String(plainDecimalSerializer.serialize(rowData));
        assertEquals(plainDecimalJson, plainDecimalResult);

        String scientificDecimalJson =
                "{\"decimal1\":123.456789,\"decimal2\":4.5462186404924617E+17,\"decimal3\":2.7E-8}";

        String scientificDecimalResult = new String(scientificDecimalSerializer.serialize(rowData));
        assertEquals(scientificDecimalJson, scientificDecimalResult);
    }