Class DefaultAttributeValueToRepresentationStrategyTest


  • @UnitTest
    public class DefaultAttributeValueToRepresentationStrategyTest
    extends java.lang.Object
    • Constructor Detail

      • DefaultAttributeValueToRepresentationStrategyTest

        public DefaultAttributeValueToRepresentationStrategyTest()
    • Method Detail

      • setUp

        public void setUp()
      • givenSimpleAttribute_WhenCalled_ThenItReturnsItsSimpleRepresentation

        public void givenSimpleAttribute_WhenCalled_ThenItReturnsItsSimpleRepresentation()
      • givenCollectionAttribute_WhenCalled_ThenItReturnsACollectionOfSimpleRepresentations

        public void givenCollectionAttribute_WhenCalled_ThenItReturnsACollectionOfSimpleRepresentations()
      • givenLocalizedItem_WhenCalled_ThenItReturnsMapWithRepresentationForEachLanguage

        public void givenLocalizedItem_WhenCalled_ThenItReturnsMapWithRepresentationForEachLanguage()
      • givenLocalizedCollection_WhenCalled_ThenItReturnsMapWithTransformedCollectionForEachLanguage

        public void givenLocalizedCollection_WhenCalled_ThenItReturnsMapWithTransformedCollectionForEachLanguage()
      • givenEmptyMap_WhenConvertLocalizedValueIsCalled_ThenItReturnsNull

        public void givenEmptyMap_WhenConvertLocalizedValueIsCalled_ThenItReturnsNull()
      • givenMap_WhenConvertLocalizedValueIsCalled_ThenTheValueForEachValueIsTransformed

        public void givenMap_WhenConvertLocalizedValueIsCalled_ThenTheValueForEachValueIsTransformed()
      • givenInvalidParameter_WhenConvertLocalizedValueIsCalled_ThenTheValidationExceptionIsTriggeredAndHandled

        public void givenInvalidParameter_WhenConvertLocalizedValueIsCalled_ThenTheValidationExceptionIsTriggeredAndHandled()
      • givenNotSupportedParameter_WhenConvertLocalizedValueIsCalled_ThenTheConversionExceptionIsTriggeredAndHandled

        public void givenNotSupportedParameter_WhenConvertLocalizedValueIsCalled_ThenTheConversionExceptionIsTriggeredAndHandled()
      • WhenConvertLocalizedValueIsCalled_AndThereIsAnException_ThenExceptionIsNotCaught

        public void WhenConvertLocalizedValueIsCalled_AndThereIsAnException_ThenExceptionIsNotCaught()
      • GivenCloneComponentContextProviderIsInitialized_WhenConvertLocalizedValueIsCalled_ThenItInitializesTheItemInThatContext

        public void GivenCloneComponentContextProviderIsInitialized_WhenConvertLocalizedValueIsCalled_ThenItInitializesTheItemInThatContext()
      • GivenCloneComponentContextProviderIsNotInitialized_WhenConvertLocalizedValueIsCalled_ThenItDoesNotInitializeTheItem

        public void GivenCloneComponentContextProviderIsNotInitialized_WhenConvertLocalizedValueIsCalled_ThenItDoesNotInitializeTheItem()
      • addModelToValueMapping

        protected void addModelToValueMapping​(ItemModel source,
                                              java.lang.Object returnValue)
      • addModelToValueMapping

        protected void addModelToValueMapping​(ItemModel source,
                                              java.util.Locale locale,
                                              java.lang.Object returnValue)
      • setUpLanguageValueMap

        protected void setUpLanguageValueMap()
      • throwExceptionWhenFunctionExecutes

        public void throwExceptionWhenFunctionExecutes​(java.lang.String parameter,
                                                       de.hybris.platform.cmsfacades.cmsitems.converter.DefaultAttributeValueToRepresentationStrategyTest.ExceptionType exceptionType)