use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.WorksetPage.Field in project miso-lims by miso-lims.
the class WorksetPageIT method testCreate.
@Test
public void testCreate() {
WorksetPage page = getWorksetPage(null);
Map<Field, String> fields = new HashMap<>();
fields.put(Field.ALIAS, "Test Set");
fields.put(Field.DESCRIPTION, "Test description");
page.setFields(fields);
assertEquals("", page.getField(Field.ID));
assertFieldValues("changes pre-save", fields, page);
WorksetPage savedPage = page.clickSave();
assertNotNull("Workset should save successfully", savedPage);
assertFieldValues("changes post-save", fields, savedPage);
Workset workset = (Workset) getSession().get(Workset.class, Long.valueOf(savedPage.getField(Field.ID)));
assertEquals(fields.get(Field.ALIAS), workset.getAlias());
assertEquals(fields.get(Field.DESCRIPTION), workset.getDescription());
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.WorksetPage.Field in project miso-lims by miso-lims.
the class WorksetPageIT method testEdit.
@Test
public void testEdit() {
WorksetPage page = getWorksetPage(1L);
Map<Field, String> fields = getWorksetOneFields();
Map<Field, String> changes = new HashMap<>();
changes.put(Field.ALIAS, "New Alias");
changes.put(Field.DESCRIPTION, "New Desc");
page.setFields(changes);
fields.putAll(changes);
assertFieldValues("changes pre-save", fields, page);
WorksetPage savedPage = page.clickSave();
assertNotNull("Workset should save successfully", savedPage);
assertFieldValues("changes post-save", fields, savedPage);
Workset workset = (Workset) getSession().get(Workset.class, Long.valueOf(savedPage.getField(Field.ID)));
assertEquals(fields.get(Field.ALIAS), workset.getAlias());
assertEquals(fields.get(Field.DESCRIPTION), workset.getDescription());
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.WorksetPage.Field in project miso-lims by miso-lims.
the class WorksetPageIT method testNullifyFields.
@Test
public void testNullifyFields() {
WorksetPage page = getWorksetPage(1L);
Map<Field, String> fields = getWorksetOneFields();
assertFieldValues("original", fields, page);
page.setField(Field.DESCRIPTION, null);
fields.put(Field.DESCRIPTION, null);
assertFieldValues("changes pre-save", fields, page);
WorksetPage savedPage = page.clickSave();
assertNotNull("Workset should save successfully", savedPage);
assertFieldValues("changes post-save", fields, savedPage);
Workset workset = (Workset) getSession().get(Workset.class, 1L);
assertTrue(LimsUtils.isStringEmptyOrNull(workset.getDescription()));
}
Aggregations