use of org.alfresco.rest.framework.resource.parameters.Parameters in project records-management by Alfresco.
the class RMSiteEntityResourceUnitTest method updateRMSiteCompliance.
@Test
public void updateRMSiteCompliance() throws Exception {
String siteId = RM_SITE_ID;
Params parameters = mock(Params.class);
RMSite site = new RMSite();
site.setTitle("New Title");
site.setDescription("New Description");
site.setCompliance(RMSiteCompliance.STANDARD);
try {
rmSiteEntityResource.update(siteId, site, parameters);
fail("Expected ecxeption as rm site compliance cannot be changed.");
} catch (InvalidArgumentException ex) {
assertEquals("Site update does not support field: compliance", ex.getMsgId());
}
verify(mockedRMSites, never()).updateRMSite(any(String.class), any(SiteUpdate.class), any(Parameters.class));
}
use of org.alfresco.rest.framework.resource.parameters.Parameters in project records-management by Alfresco.
the class RMSiteEntityResourceUnitTest method updateRMSiteId.
@Test
public void updateRMSiteId() throws Exception {
String siteId = RM_SITE_ID;
Params parameters = mock(Params.class);
RMSite site = new RMSite();
site.setTitle("New Title");
site.setDescription("New Description");
site.setId("newSiteID");
try {
rmSiteEntityResource.update(siteId, site, parameters);
fail("Expected ecxeption as rm site id cannot be changed.");
} catch (InvalidArgumentException ex) {
assertEquals("Site update does not support field: id", ex.getMsgId());
}
verify(mockedRMSites, never()).updateRMSite(any(String.class), any(SiteUpdate.class), any(Parameters.class));
}
use of org.alfresco.rest.framework.resource.parameters.Parameters in project records-management by Alfresco.
the class RMSiteEntityResourceUnitTest method updateRMSiteVisibility.
@Test
public void updateRMSiteVisibility() throws Exception {
String siteId = RM_SITE_ID;
Params parameters = mock(Params.class);
RMSite site = new RMSite();
site.setTitle("New Title");
site.setDescription("New Description");
site.setVisibility(SiteVisibility.PRIVATE);
try {
rmSiteEntityResource.update(siteId, site, parameters);
fail("Expected ecxeption as rm site visibility cannot be changed.");
} catch (InvalidArgumentException ex) {
assertEquals("Site update does not support field: visibility", ex.getMsgId());
}
verify(mockedRMSites, never()).updateRMSite(any(String.class), any(SiteUpdate.class), any(Parameters.class));
}
Aggregations