Class AttributeConstraintInterceptorTest

java.lang.Object
de.hybris.platform.validation.interceptors.AttributeConstraintInterceptorTest

@UnitTest public class AttributeConstraintInterceptorTest extends Object
This test tests the AttributeConstraint preparer and validator.
  • Constructor Details

    • AttributeConstraintInterceptorTest

      public AttributeConstraintInterceptorTest()
  • Method Details

    • init

      public void init()
      creating some dummy data.
    • testPreparerWithEmptyConstraint

      public void testPreparerWithEmptyConstraint() throws InterceptorException
      Testing Preparer with empty constraint. Expect: nothing changes.
      Throws:
      InterceptorException
    • testPreparerWithAttributeDescriptorOnly

      public void testPreparerWithAttributeDescriptorOnly() throws InterceptorException
      Testing preparer, descriptor is set, other attributes filled with dummy data. Expect: descriptor overwrites all other fields.
      Throws:
      InterceptorException
    • testValidatorWithNullAnnotation

      public void testValidatorWithNullAnnotation()
      Testing validator with empty constraint. Expect: exception, annotation is not set.
    • testValidatorItemModelOK

      public void testValidatorItemModelOK() throws InterceptorException
      Testing validator with an itemmodel which is ok. Expect: nothing.
      Throws:
      InterceptorException
    • testValidatorPojoOk

      public void testValidatorPojoOk() throws InterceptorException
      Testing validator with a correct pojo. Expect: nothing happens.
      Throws:
      InterceptorException
    • testValidatorPojoFail2

      public void testValidatorPojoFail2() throws InterceptorException
      Test validator. Pojo is ok, attribute qualifier exists, but it is all lower case. Expect: exception.
      Throws:
      InterceptorException
    • testValidatorPojoFails

      public void testValidatorPojoFails() throws InterceptorException
      Testing validator with incorrect pojo. Expect: exception
      Throws:
      InterceptorException
    • testValidatorEmptyQualifier

      public void testValidatorEmptyQualifier() throws InterceptorException
      Testing validator where qualifier is only missing. Expect: exception
      Throws:
      InterceptorException