// Path: src/main/java/io/datanerds/avropatch/value/type/BigDecimalType.java
// public interface BigDecimalType {
//     String NAME = "big-decimal";
//     String DOC = "BigDecimal value represented via its scale and unscaled value.";
//     LogicalType LOGICAL_TYPE = new LogicalType(NAME);
//     Schema RECORD = SchemaBuilder
//             .record("decimal")
//             .doc(DOC)
//             .fields()
//             .name("unscaledValue").type(BigIntegerType.SCHEMA).noDefault()
//             .name("scale").type(Schema.create(Schema.Type.INT)).noDefault()
//             .endRecord();
// 
//     Schema SCHEMA = LOGICAL_TYPE.addToSchema(RECORD);
// }


import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.datanerds.avropatch.value.type.BigDecimalType;
import org.apache.avro.Schema;
import org.junit.Test;
import java.io.IOException;
import java.math.BigDecimal;
package io.datanerds.avropatch.value.conversion;



public class BigDecimalConversionTest {

    @Test
    public void serializesSingleValue() throws IOException {
        ConversionTester
                .withSchemata(BigDecimalType.SCHEMA)
                .withConverters(new BigIntegerConversion(), new BigDecimalConversion())
                .reserializeAndAssert(BigDecimal.valueOf(1234567890L))
                .reserializeAndAssert(new BigDecimal("1234567890123456.78901234567890123456789012345678901234567890"));
    }

    @Test
    public void serializesList() throws IOException {
        ConversionTester
                .withSchemata(Schema.createArray(BigDecimalType.SCHEMA))
                .withConverters(new BigIntegerConversion(), new BigDecimalConversion())
                .reserializeAndAssert(ImmutableList.of(BigDecimal.valueOf(1234567890L),
                        new BigDecimal("12345678901234567.8901234567890123456789012345678901234567890"),
                        new BigDecimal("9867451234560123985690347590378412095789345624401928453450891"
                                + "9894375093427509345702.349572349089034759349046758903758902347568902347589023467")));
    }

    @Test
    public void serializesMap() throws IOException {
        ConversionTester
                .withSchemata(Schema.createMap(BigDecimalType.SCHEMA))
// Path: src/main/java/io/datanerds/avropatch/value/type/BigDecimalType.java
// public interface BigDecimalType {
//     String NAME = "big-decimal";
//     String DOC = "BigDecimal value represented via its scale and unscaled value.";
//     LogicalType LOGICAL_TYPE = new LogicalType(NAME);
//     Schema RECORD = SchemaBuilder
//             .record("decimal")
//             .doc(DOC)
//             .fields()
//             .name("unscaledValue").type(BigIntegerType.SCHEMA).noDefault()
//             .name("scale").type(Schema.create(Schema.Type.INT)).noDefault()
//             .endRecord();
// 
//     Schema SCHEMA = LOGICAL_TYPE.addToSchema(RECORD);
// }


// Path: src/test/java/io/datanerds/avropatch/value/conversion/BigDecimalConversionTest.java
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.datanerds.avropatch.value.type.BigDecimalType;
import org.apache.avro.Schema;
import org.junit.Test;
import java.io.IOException;
import java.math.BigDecimal;

package io.datanerds.avropatch.value.conversion;



public class BigDecimalConversionTest {

    @Test
    public void serializesSingleValue() throws IOException {
        ConversionTester
                .withSchemata(BigDecimalType.SCHEMA)
                .withConverters(new BigIntegerConversion(), new BigDecimalConversion())
                .reserializeAndAssert(BigDecimal.valueOf(1234567890L))
                .reserializeAndAssert(new BigDecimal("1234567890123456.78901234567890123456789012345678901234567890"));
    }

    @Test
    public void serializesList() throws IOException {
        ConversionTester
                .withSchemata(Schema.createArray(BigDecimalType.SCHEMA))
                .withConverters(new BigIntegerConversion(), new BigDecimalConversion())
                .reserializeAndAssert(ImmutableList.of(BigDecimal.valueOf(1234567890L),
                        new BigDecimal("12345678901234567.8901234567890123456789012345678901234567890"),
                        new BigDecimal("9867451234560123985690347590378412095789345624401928453450891"
                                + "9894375093427509345702.349572349089034759349046758903758902347568902347589023467")));
    }

    @Test
    public void serializesMap() throws IOException {
        ConversionTester
                .withSchemata(Schema.createMap(BigDecimalType.SCHEMA))
                .withConverters(new BigIntegerConversion(), new BigDecimalConversion())