1. David Black
  2. atlassian-soy-templates

Commits

David Black  committed ef84bad

SOY-46: Add a test for the fix about not converting existing SoyData instances.

Signed-off-by: David Black <dblack@atlassian.com>

  • Participants
  • Parent commits 20058e8
  • Branches issue/SOY-46

Comments (0)

Files changed (1)

File core/src/test/java/com/atlassian/soy/impl/data/SoyDataConverterTest.java

View file
 
 import com.atlassian.soy.renderer.CustomSoyDataMapper;
 import com.atlassian.soy.renderer.SoyDataMapper;
+import com.google.template.soy.data.SanitizedContent;
 import com.google.template.soy.data.SoyData;
 import com.google.template.soy.data.SoyListData;
 import com.google.template.soy.data.SoyMapData;
         assertConvertsToType(new SoyMapData(Collections.singletonMap("key", 1)), Map.class);
     }
 
+    /**
+     * Existing SoyData instances should not be modified.
+     */
+    @Test
+    public void testConvertExistingSoyData()
+    {
+        SoyData soyData = new SanitizedContent("ha!",
+            SanitizedContent.ContentKind.HTML);
+        assertConvertsToType((Object)soyData, SanitizedContent.class);
+    }
+
     public void assertConvertsToType(SoyData value, Class<?> type)
     {
         final Object object = SoyDataConverter.convertFromSoyData(value);