0 Replies Latest reply on Oct 3, 2014 3:52 AM by Matthias Jell

    Replacement of MockValidator?? returns null instead empty Set

    Matthias Jell Newbie

      Hi,

       

      arquillian-weld-ee-embedded-1.1 provides a mock injection of javax.vadidation.Validator.

      The problem of this mock implementation is, that it returns null in the validation methods, instead a empty set.

      Is there a posibillity to replace/deactivate these mock implementation and use a custom one?

       

      thx Matthias

       

      MockValidator excerpt:

       

      public <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups)
      {
            // TODO Auto-generated method stub
            return null;
      }
      
      public <T> Set<ConstraintViolation<T>> validateProperty(T object, String propertyName, Class<?>... groups)
      {
          // TODO Auto-generated method stub
          return null;
      }
      
      
       public <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value, Class<?>... groups)
      {
          // TODO Auto-generated method stub
          return null;
      }
      
      

       

      pom.xml excerpt:

      <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <version>1.1.5.Final</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian.protocol</groupId>
        <artifactId>arquillian-protocol-servlet</artifactId>
        <version>1.1.5.Final</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-depchain</artifactId>
        <version>2.1.0</version>
        <type>pom</type>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian.container</groupId>
        <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
        <version>1.0.0.CR8</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.shrinkwrap.descriptors</groupId>
        <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
        <version>2.0.0-alpha-5</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.weld</groupId>
        <artifactId>weld-core</artifactId>
        <version>1.1.19.Final</version>
        <scope>test</scope>
      </dependency>