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