assertEquals(_group1_Name1_SchematronId1.getCriteria().size(), result.getChild(GeonetEntity.RECORD_EL_NAME).getChild("criteria").getChildren().size());
}
@Test
public void testExecEditSchematronId() throws Exception {
Schematron newSchematron = _schematronRepository.save(SchematronRepositoryTest.newSchematron(_inc));
ServiceContext context = createServiceContext();
loginAsAdmin(context);
Element editParams = createParams(
read(SchematronCriteriaGroupService.PARAM_GROUP_NAME, _group1_Name1_SchematronId1.getId().getName()),
read(SchematronCriteriaGroupService.PARAM_SCHEMATRON_ID, _group1_Name1_SchematronId1.getId().getSchematronId()),
read(SchematronCriteriaGroupService.PARAM_NEW_SCHEMATRON_ID, newSchematron.getId())
);
Element result = createService(EDIT).exec(editParams, context);
assertEquals("ok", result.getName());
Element listParamsOldName = createParams(
read(SchematronCriteriaGroupService.PARAM_GROUP_NAME, _group1_Name1_SchematronId1.getId().getName()),
read(SchematronCriteriaGroupService.PARAM_SCHEMATRON_ID, _group1_Name1_SchematronId1.getId().getSchematronId())
);
result = createService(EXISTS).exec(listParamsOldName, context);
assertEquals(""+false, result.getText());
Element listParamsNewName = createParams(
read(SchematronCriteriaGroupService.PARAM_GROUP_NAME, _group1_Name1_SchematronId1.getId().getName()),
read(SchematronCriteriaGroupService.PARAM_SCHEMATRON_ID, newSchematron.getId())
);
result = createService(LIST).exec(listParamsNewName, context);
assertEquals(1, result.getChildren().size());