use of edu.harvard.iq.dataverse.engine.DataverseEngine in project dataverse by IQSS.
the class UpdatePermissionRootCommandTest method testNoChange.
@Test
public void testNoChange() throws CommandException {
Dataverse dv = MocksFactory.makeDataverse();
DataverseEngine ngn = new TestDataverseEngine(testCommandContext);
dv.setPermissionRoot(false);
UpdatePermissionRootCommand sut = new UpdatePermissionRootCommand(false, MocksFactory.makeRequest(), dv);
Dataverse result = ngn.submit(sut);
assertFalse(result.isPermissionRoot());
assertFalse(serviceBeanCalled);
dv.setPermissionRoot(true);
sut = new UpdatePermissionRootCommand(true, MocksFactory.makeRequest(), dv);
result = ngn.submit(sut);
assertTrue(result.isPermissionRoot());
assertFalse(serviceBeanCalled);
}
use of edu.harvard.iq.dataverse.engine.DataverseEngine in project dataverse by IQSS.
the class UpdatePermissionRootCommandTest method testChange.
@Test
public void testChange() throws CommandException {
Dataverse dv = MocksFactory.makeDataverse();
DataverseEngine ngn = new TestDataverseEngine(testCommandContext);
dv.setPermissionRoot(false);
UpdatePermissionRootCommand sut = new UpdatePermissionRootCommand(true, MocksFactory.makeRequest(), dv);
Dataverse result = ngn.submit(sut);
assertTrue(result.isPermissionRoot());
assertTrue(serviceBeanCalled);
dv.setPermissionRoot(true);
sut = new UpdatePermissionRootCommand(false, MocksFactory.makeRequest(), dv);
result = ngn.submit(sut);
assertFalse(result.isPermissionRoot());
assertTrue(serviceBeanCalled);
}
Aggregations