// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java
// public class TypeConverterException extends RuntimeException {
//     private static final long serialVersionUID = -7577535992947276304L;
//     public TypeConverterException(String message) {
//         super(message);
//     }
// }


import com.nordea.oss.copybook.exceptions.TypeConverterException;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.nio.charset.StandardCharsets;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
/*
 * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk>
 * Copyright (c) 2016. Nordea Bank AB
 * Licensed under the MIT license (LICENSE.txt)
 */

package com.nordea.oss.copybook.converters;




public class StringToTypeConverterStringEnumTest {
    private TypeConverter typeConverter;
    private TypeConverterConfig config;

    public enum TestStringEnum implements TypeConverterStringEnum {
        HIGH("HH"), MEDIUM("MM"), LOW("LL");
        private final String value;

        TestStringEnum(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }


    @Rule
    public ExpectedException expectedEx = ExpectedException.none();

    @Before
    public void runBeforeEveryTest() {
        this.config = new TypeConverterConfig();
        this.config.setCharset(StandardCharsets.UTF_8);
        this.config.setPaddingChar('0');
        typeConverter = new StringToTypeConverterStringEnum();
        typeConverter.initialize(config);
        typeConverter.validate(TestStringEnum.class, 2, 1);
    }

    @Test
    public void testValidateSuccess() throws Exception {
        typeConverter.validate(TestStringEnum.class, 2, -1);
    }

// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java
// public class TypeConverterException extends RuntimeException {
//     private static final long serialVersionUID = -7577535992947276304L;
//     public TypeConverterException(String message) {
//         super(message);
//     }
// }


// Path: copybook4java/src/test/java/com/nordea/oss/copybook/converters/StringToTypeConverterStringEnumTest.java
import com.nordea.oss.copybook.exceptions.TypeConverterException;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.nio.charset.StandardCharsets;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

/*
 * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk>
 * Copyright (c) 2016. Nordea Bank AB
 * Licensed under the MIT license (LICENSE.txt)
 */

package com.nordea.oss.copybook.converters;




public class StringToTypeConverterStringEnumTest {
    private TypeConverter typeConverter;
    private TypeConverterConfig config;

    public enum TestStringEnum implements TypeConverterStringEnum {
        HIGH("HH"), MEDIUM("MM"), LOW("LL");
        private final String value;

        TestStringEnum(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }


    @Rule
    public ExpectedException expectedEx = ExpectedException.none();

    @Before
    public void runBeforeEveryTest() {
        this.config = new TypeConverterConfig();
        this.config.setCharset(StandardCharsets.UTF_8);
        this.config.setPaddingChar('0');
        typeConverter = new StringToTypeConverterStringEnum();
        typeConverter.initialize(config);
        typeConverter.validate(TestStringEnum.class, 2, 1);
    }

    @Test
    public void testValidateSuccess() throws Exception {
        typeConverter.validate(TestStringEnum.class, 2, -1);
    }

    @Test(expected = TypeConverterException.class)