1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.krad.datadictionary;
18
19 import org.junit.Before;
20 import org.junit.Test;
21 import org.kuali.rice.kew.doctype.bo.DocumentType;
22 import org.kuali.rice.kew.doctype.bo.DocumentTypeEBO;
23 import org.kuali.rice.kew.doctype.service.DocumentTypeService;
24 import org.kuali.rice.kew.service.KEWServiceLocator;
25 import org.kuali.rice.krad.service.DataDictionaryService;
26 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
27 import org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl;
28 import org.kuali.rice.krad.test.KRADTestCase;
29 import org.springframework.context.support.ClassPathXmlApplicationContext;
30
31 import java.util.List;
32 import java.util.Map;
33
34 import static org.junit.Assert.assertTrue;
35 import static org.junit.Assert.assertNotNull;
36 import static org.junit.Assert.assertEquals;
37
38 public class DataDictionaryTest extends KRADTestCase {
39 private DataDictionaryService ddService;
40 private DocumentTypeService dtService;
41
42 @Before
43 public void setUp() throws Exception {
44 super.setUp();
45 ddService = KRADServiceLocatorWeb.getDataDictionaryService();
46 dtService = KEWServiceLocator.getDocumentTypeService();
47 }
48
49 @Test
50 public void testDocumentTypeEBO() throws Exception {
51 DataDictionary dataDictionary = ddService.getDataDictionary();
52 Map<String, DocumentEntry> documentEntry = dataDictionary.getDocumentEntries();
53 DocumentEntry entry = documentEntry.get("DocumentTypeEBO");
54 DocumentTypeEBO documentType = dtService.findByName(entry.getDocumentTypeName());
55 assertNotNull(documentType);
56 assertNotNull(documentType.getDocTypeParentId());
57 assertNotNull(documentType.getDocumentTypeId());
58 assertEquals("Travel Authorization Document",documentType.getLabel());
59 assertEquals("DocumentTypeEBO",documentType.getName());
60 assertEquals("Create a New Travel Authorization Document",documentType.getDescription());
61 assertTrue(documentType.isActive());
62 }
63 }