Search in sources :

Example 1 with MockResourceDataBean

use of com.agiletec.plugins.jacms.aps.system.services.resource.mock.MockResourceDataBean in project entando-core by entando.

the class ResourceManagerIntegrationTest method getNullMockResource.

private ResourceDataBean getNullMockResource(String resourceType, String resDescrToAdd) {
    MockResourceDataBean bean = new MockResourceDataBean();
    bean.setDescr(resDescrToAdd);
    bean.setMainGroup(Group.FREE_GROUP_NAME);
    bean.setResourceType(resourceType);
    bean.setMimeType("text/plain");
    return bean;
}
Also used : MockResourceDataBean(com.agiletec.plugins.jacms.aps.system.services.resource.mock.MockResourceDataBean)

Example 2 with MockResourceDataBean

use of com.agiletec.plugins.jacms.aps.system.services.resource.mock.MockResourceDataBean in project entando-core by entando.

the class ResourceManagerIntegrationTest method getMockResource.

private ResourceDataBean getMockResource(String resourceType, String mainGroup, String resDescrToAdd, String categoryCodeToAdd) {
    File file = new File("target/test/entando_logo.jpg");
    MockResourceDataBean bean = new MockResourceDataBean();
    bean.setFile(file);
    bean.setDescr(resDescrToAdd);
    bean.setMainGroup(mainGroup);
    bean.setResourceType(resourceType);
    bean.setMimeType("image/jpeg");
    List<Category> categories = new ArrayList<Category>();
    ICategoryManager catManager = (ICategoryManager) this.getService(SystemConstants.CATEGORY_MANAGER);
    Category cat = catManager.getCategory(categoryCodeToAdd);
    categories.add(cat);
    bean.setCategories(categories);
    return bean;
}
Also used : Category(com.agiletec.aps.system.services.category.Category) MockResourceDataBean(com.agiletec.plugins.jacms.aps.system.services.resource.mock.MockResourceDataBean) ArrayList(java.util.ArrayList) File(java.io.File) ICategoryManager(com.agiletec.aps.system.services.category.ICategoryManager)

Aggregations

MockResourceDataBean (com.agiletec.plugins.jacms.aps.system.services.resource.mock.MockResourceDataBean)2 Category (com.agiletec.aps.system.services.category.Category)1 ICategoryManager (com.agiletec.aps.system.services.category.ICategoryManager)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1