View Javadoc

1   package org.kuali.ole.fixture;
2   
3   import org.kuali.ole.patron.bo.OlePatronDocument;
4   import org.kuali.rice.kim.impl.identity.address.EntityAddressBo;
5   import org.kuali.rice.kim.impl.identity.email.EntityEmailBo;
6   import org.kuali.rice.kim.impl.identity.name.EntityNameBo;
7   import org.kuali.rice.kim.impl.identity.phone.EntityPhoneBo;
8   import org.kuali.rice.krad.service.BusinessObjectService;
9   import org.kuali.rice.krad.service.KRADServiceLocator;
10  
11  import java.util.*;
12  
13  import static junit.framework.Assert.assertNotNull;
14  
15  /**
16   * Created with IntelliJ IDEA.
17   * User: ?
18   * Date: 5/23/12
19   * Time: 3:16 PM
20   * To change this template use File | Settings | File Templates.
21   */
22  
23  public enum OlePatronDocumentFixture {
24      PATRON_DOC(),;
25      private BusinessObjectService businessObjectService;
26  
27      private OlePatronDocumentFixture() { }
28          public OlePatronDocument createPatron() {
29              businessObjectService = KRADServiceLocator.getBusinessObjectService();
30              OlePatronDocument patronDocument = new OlePatronDocument();
31              EntityNameBo entityNameBo = new EntityNameBo();
32              entityNameBo.setNameCode("PRFR");
33              entityNameBo.setFirstName("mockFirstName");
34              entityNameBo.setLastName("mockLastName");
35  
36              EntityAddressBo entityAddressBo = new EntityAddressBo();
37              entityAddressBo.setLine1("mockLine1");
38              entityAddressBo.setLine2("mockLine2");
39              entityAddressBo.setAddressTypeCode("HM");
40              entityAddressBo.setStateProvinceCode("IL");
41  
42              EntityEmailBo entityEmailBo = new EntityEmailBo();
43              entityEmailBo.setEmailTypeCode("HM");
44              entityEmailBo.setEmailAddress("test@mock");
45  
46              EntityPhoneBo entityPhoneBo = new EntityPhoneBo();
47              entityPhoneBo.setPhoneNumber("987654321");
48              entityPhoneBo.setCountryCode("US");
49              entityPhoneBo.setPhoneTypeCode("MBL");
50  
51              OlePatronDocument olePatron= new OlePatronDocument();
52              olePatron.setBarcode("mockBarcode");
53  
54              olePatron.setName(entityNameBo);
55              olePatron.setAddresses(Arrays.asList(entityAddressBo));
56              olePatron.setEmails(Arrays.asList(entityEmailBo));
57              olePatron.setPhones(Arrays.asList(entityPhoneBo));
58              return patronDocument;
59          }
60  
61  }