Search in sources :

Example 11 with UpdateEntity

use of org.activityinfo.shared.command.UpdateEntity in project activityinfo by bedatadriven.

the class TargetTest method updateTargetNameTest.

@Test
public void updateTargetNameTest() throws Throwable {
    Map<String, Object> changes1 = new HashMap<String, Object>();
    changes1.put("name", "newNameOfTarget");
    execute(new BatchCommand(new UpdateEntity("Target", 1, changes1)));
    List<TargetDTO> targets = execute(new GetTargets(db.getId())).getData();
    TargetDTO dto = getTargetById(targets, 1);
    Assert.assertEquals("newNameOfTarget", dto.getName());
}
Also used : GetTargets(org.activityinfo.shared.command.GetTargets) UpdateEntity(org.activityinfo.shared.command.UpdateEntity) HashMap(java.util.HashMap) BatchCommand(org.activityinfo.shared.command.BatchCommand) TargetDTO(org.activityinfo.shared.dto.TargetDTO) Test(org.junit.Test)

Aggregations

UpdateEntity (org.activityinfo.shared.command.UpdateEntity)11 Test (org.junit.Test)9 SchemaDTO (org.activityinfo.shared.dto.SchemaDTO)6 HashMap (java.util.HashMap)5 GetSchema (org.activityinfo.shared.command.GetSchema)4 VoidResult (org.activityinfo.shared.command.result.VoidResult)4 Record (com.extjs.gxt.ui.client.store.Record)3 ActivityDTO (org.activityinfo.shared.dto.ActivityDTO)3 TreeStore (com.extjs.gxt.ui.client.store.TreeStore)2 MockEventBus (org.activityinfo.client.MockEventBus)2 DispatcherStub (org.activityinfo.client.dispatch.DispatcherStub)2 UIConstants (org.activityinfo.client.i18n.UIConstants)2 StateManagerStub (org.activityinfo.client.mock.StateManagerStub)2 BatchCommand (org.activityinfo.shared.command.BatchCommand)2 LocalDate (com.bedatadriven.rebar.time.calendar.LocalDate)1 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)1 NavigationCallback (org.activityinfo.client.page.NavigationCallback)1 FormDialogCallback (org.activityinfo.client.page.common.dialog.FormDialogCallback)1 FormDialogTether (org.activityinfo.client.page.common.dialog.FormDialogTether)1 DataEntryPlace (org.activityinfo.client.page.entry.place.DataEntryPlace)1