Search in sources :

Example 61 with Category

use of org.hisp.dhis.category.Category in project dhis2-core by dhis2.

the class SharingControllerTest method systemDefaultMetadata.

@Test
void systemDefaultMetadata() throws Exception {
    final Category category = new Category();
    category.setName(Category.DEFAULT_NAME);
    doReturn(Category.class).when(aclService).classForType(eq("category"));
    when(aclService.isClassShareable(eq(Category.class))).thenReturn(true);
    when(manager.getNoAcl(eq(Category.class), eq("kkSjhdhks"))).thenReturn(category);
    WebMessage message = sharingController.postSharing("category", "kkSjhdhks", request);
    assertThat(message.getMessage(), containsString("Sharing settings of system default metadata object"));
}
Also used : Category(org.hisp.dhis.category.Category) WebMessage(org.hisp.dhis.dxf2.webmessage.WebMessage) Test(org.junit.jupiter.api.Test)

Aggregations

Category (org.hisp.dhis.category.Category)61 CategoryOption (org.hisp.dhis.category.CategoryOption)25 CategoryCombo (org.hisp.dhis.category.CategoryCombo)22 Test (org.junit.jupiter.api.Test)21 CategoryOptionCombo (org.hisp.dhis.category.CategoryOptionCombo)13 CategoryOptionGroupSet (org.hisp.dhis.category.CategoryOptionGroupSet)13 ArrayList (java.util.ArrayList)12 User (org.hisp.dhis.user.User)12 DataElement (org.hisp.dhis.dataelement.DataElement)11 HashSet (java.util.HashSet)8 DataSet (org.hisp.dhis.dataset.DataSet)8 OrganisationUnitGroupSet (org.hisp.dhis.organisationunit.OrganisationUnitGroupSet)8 HashMap (java.util.HashMap)7 Date (java.util.Date)5 AnalyticsTableColumn (org.hisp.dhis.analytics.AnalyticsTableColumn)5 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)5 OrganisationUnitLevel (org.hisp.dhis.organisationunit.OrganisationUnitLevel)5 List (java.util.List)4 DataQueryParams (org.hisp.dhis.analytics.DataQueryParams)4 Attribute (org.hisp.dhis.attribute.Attribute)4