Class TypeConstraintInterceptorTest

    • Constructor Detail

      • TypeConstraintInterceptorTest

        public TypeConstraintInterceptorTest()
    • Method Detail

      • init

        public void init()
        create needed dummy data.
      • testPrepareWithEmptyModel

        public void testPrepareWithEmptyModel()
                                       throws InterceptorException
        Tests preparer with empty constraint. Expect: nothing changes, no exception
        Throws:
        InterceptorException
      • testValidateWithEmptyModel

        public void testValidateWithEmptyModel()
                                        throws InterceptorException
        Test validator with empty constraint Expect: IllegalArgumentException because no annotation class is set
        Throws:
        InterceptorException
      • testValidateWithAnnotationAttributeOnly

        public void testValidateWithAnnotationAttributeOnly()
                                                     throws InterceptorException
        Test validator with constrant where only an annotation is set expect: InterceptorException because target is not set
        Throws:
        InterceptorException
      • testValidateWithFalseAnnotationAttribute

        public void testValidateWithFalseAnnotationAttribute()
                                                      throws InterceptorException
        Test validator with false annotation. Expect: IllegalArgumentException because annotation class is not an annotation
        Throws:
        InterceptorException
      • testValidator1

        public void testValidator1()
                            throws InterceptorException
        Test validator with a constraint where only a pojo as target is set (and the annotation). Expect: nothing happens
        Throws:
        InterceptorException
      • testValidator2

        public void testValidator2()
                            throws InterceptorException
        Test validator, target and type are incompatible to each other. Expect: IllegalArgumentException
        Throws:
        InterceptorException
      • testValidator3

        public void testValidator3()
                            throws InterceptorException
        Test validator. target contains a different composedtype as given in the type. Expect: IllegalArgumentException
        Throws:
        InterceptorException
      • testValidator4

        public void testValidator4()
                            throws InterceptorException
        Test validator. Constraint has only the target set but which is a model. Expect: InterceptorException
        Throws:
        InterceptorException