Search in sources :

Example 1 with CategoryAction

use of com.agiletec.apsadmin.category.CategoryAction in project entando-core by entando.

the class TestTrashReferencedCategory method testTrashReferencedCategory.

public void testTrashReferencedCategory() throws Throwable {
    String categoryCode = "evento";
    Category masterCategory = this._categoryManager.getCategory(categoryCode);
    assertNotNull(masterCategory);
    try {
        this.setUserOnSession("admin");
        this.initAction("/do/Category", "trash");
        this.addParameter("selectedNode", categoryCode);
        String result = this.executeAction();
        assertEquals("references", result);
        CategoryAction action = (CategoryAction) this.getAction();
        Map<String, List> references = action.getReferences();
        assertEquals(2, references.size());
        List contentReferences = references.get(JacmsSystemConstants.CONTENT_MANAGER + "Utilizers");
        assertEquals(2, contentReferences.size());
        for (int i = 0; i < contentReferences.size(); i++) {
            String contentId = (String) contentReferences.get(i);
            assertTrue(contentId.equals("EVN193") || contentId.equals("EVN192"));
        }
    } catch (Throwable t) {
        throw t;
    }
}
Also used : Category(com.agiletec.aps.system.services.category.Category) List(java.util.List) CategoryAction(com.agiletec.apsadmin.category.CategoryAction)

Aggregations

Category (com.agiletec.aps.system.services.category.Category)1 CategoryAction (com.agiletec.apsadmin.category.CategoryAction)1 List (java.util.List)1