use of org.activityinfo.model.type.ReferenceType in project activityinfo by bedatadriven.
the class LookupViewModelTest method noKeysTest.
@Test
public void noKeysTest() {
TestingStorageProvider catalog = new TestingStorageProvider();
NfiForm nfiForm = catalog.getNfiForm();
FormTree formTree = catalog.getFormTree(nfiForm.getFormId());
FormField referenceField = new FormField(ResourceId.generateFieldId(ReferenceType.TYPE_CLASS)).setType(new ReferenceType(Cardinality.SINGLE, nfiForm.getFormId()));
LookupViewModel viewModel = new LookupViewModel(setup.getFormStore(), formTree, referenceField);
LookupKeyViewModel keyViewModel = viewModel.getLookupKeys().get(0);
Connection<List<String>> choices = setup.connect(keyViewModel.getChoices());
assertThat(choices.assertLoaded(), hasSize(821));
}
Aggregations