// Path: src/test/java/ru/vyarus/guice/validator/customtype/ComplexBean.java
// @ComplexBeanValid
// public class ComplexBean {
// 
//     @NotNull
//     private String user;
//     private int value;
// 
//     public ComplexBean() {
//     }
// 
//     public ComplexBean(String user, int value) {
//         this.user = user;
//         this.value = value;
//     }
// 
//     public String getUser() {
//         return user;
//     }
// 
//     public void setUser(String user) {
//         this.user = user;
//     }
// 
//     public int getValue() {
//         return value;
//     }
// 
//     public void setValue(int value) {
//         this.value = value;
//     }
// }
// 
// Path: src/test/java/ru/vyarus/guice/validator/customtype/CustomService.java
// @Singleton
// public class CustomService {
// 
//     public String getRequiredValue() {
//         return "perfect";
//     }
// 
//     /* @Valid will trigger bean validation with includes entire bean validation. */
//     @ValidateOnExecution
//     public void doAction(@Valid ComplexBean bean) {
//     }
// }


import com.google.inject.Guice;
import com.google.inject.Injector;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runners.Parameterized;
import ru.vyarus.guice.validator.customtype.ComplexBean;
import ru.vyarus.guice.validator.customtype.CustomService;
import jakarta.validation.ConstraintViolationException;
import java.util.Collection;
package ru.vyarus.guice.validator;



/**
 * Check custom validator with injection.
 *
 * @author Vyacheslav Rusakov
 * @since 24.06.2014
 */
public class CustomTypeValidationTest extends AbstractParameterizedTest<CustomService> {

    public CustomTypeValidationTest(String type, CustomService service) {
        super(type, service);
    }

    @Parameterized.Parameters(name = "{index}: {0}")
    public static Collection<Object[]> generateData() {
        return AbstractParameterizedTest.generateData(CustomService.class);
    }

    @Test(expected = ConstraintViolationException.class)
    public void testValidationFail() throws Exception {
        service.doAction(new ComplexBean("soso", 12));
    }

    @Test
// Path: src/test/java/ru/vyarus/guice/validator/customtype/ComplexBean.java
// @ComplexBeanValid
// public class ComplexBean {
// 
//     @NotNull
//     private String user;
//     private int value;
// 
//     public ComplexBean() {
//     }
// 
//     public ComplexBean(String user, int value) {
//         this.user = user;
//         this.value = value;
//     }
// 
//     public String getUser() {
//         return user;
//     }
// 
//     public void setUser(String user) {
//         this.user = user;
//     }
// 
//     public int getValue() {
//         return value;
//     }
// 
//     public void setValue(int value) {
//         this.value = value;
//     }
// }
// 
// Path: src/test/java/ru/vyarus/guice/validator/customtype/CustomService.java
// @Singleton
// public class CustomService {
// 
//     public String getRequiredValue() {
//         return "perfect";
//     }
// 
//     /* @Valid will trigger bean validation with includes entire bean validation. */
//     @ValidateOnExecution
//     public void doAction(@Valid ComplexBean bean) {
//     }
// }


// Path: src/test/java/ru/vyarus/guice/validator/CustomTypeValidationTest.java
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runners.Parameterized;
import ru.vyarus.guice.validator.customtype.ComplexBean;
import ru.vyarus.guice.validator.customtype.CustomService;
import jakarta.validation.ConstraintViolationException;
import java.util.Collection;

package ru.vyarus.guice.validator;



/**
 * Check custom validator with injection.
 *
 * @author Vyacheslav Rusakov
 * @since 24.06.2014
 */
public class CustomTypeValidationTest extends AbstractParameterizedTest<CustomService> {

    public CustomTypeValidationTest(String type, CustomService service) {
        super(type, service);
    }

    @Parameterized.Parameters(name = "{index}: {0}")
    public static Collection<Object[]> generateData() {
        return AbstractParameterizedTest.generateData(CustomService.class);
    }

    @Test(expected = ConstraintViolationException.class)
    public void testValidationFail() throws Exception {
        service.doAction(new ComplexBean("soso", 12));
    }

    @Test
    public void testValidation() throws Exception {