@Test
public void test_getAllComponentsByNamespaceCode_exists() throws Exception{

    setupDataObjectServiceFetchComponent();
    when(dataObjectService.findMatching(Matchers.argThat(
            new ClassOrSubclassMatcher<DerivedComponentBo>(DerivedComponentBo.class)),
            any(QueryByCriteria.class))).thenReturn(null);
    List<Component> components = getComponentService().getAllComponentsByNamespaceCode(NAMESPACE_CODE);
    assertTrue("getAllComponentsByNamespaceCode retrieved correctly", components != null && components.size() == 1);
    assertTrue("Component was returned", StringUtils.equals(component.getCode(), components.get(0).getCode()));
    assertImmutableList(components);
    verify(dataObjectService,times(1)).findMatching(Matchers.argThat(
            new ClassOrSubclassMatcher<ComponentBo>(ComponentBo.class)), any(QueryByCriteria.class));
    verify(dataObjectService,times(1)).findMatching(Matchers.argThat(
            new ClassOrSubclassMatcher<DerivedComponentBo>(DerivedComponentBo.class)), any(QueryByCriteria.class));
}