use of com.adobe.cq.dam.cfm.FragmentTemplate in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ContentFragmentUtilsTest method getTypeWhenResourceIsNull.
@Test
public void getTypeWhenResourceIsNull() {
// GIVEN
FragmentTemplate fragmentTemplate = Mockito.mock(FragmentTemplate.class);
ContentFragment contentFragment = Mockito.mock(ContentFragment.class);
Mockito.when(contentFragment.getTemplate()).thenReturn(fragmentTemplate);
Mockito.when(contentFragment.getName()).thenReturn("foobar");
// WHEN
String type = ContentFragmentUtils.getType(contentFragment);
// THEN
Assertions.assertEquals(type, "foobar");
}
Aggregations