001package org.kuali.ole.fixture; 002 003import org.kuali.ole.deliver.bo.OlePatronDocument; 004import org.kuali.rice.kim.impl.identity.address.EntityAddressBo; 005import org.kuali.rice.kim.impl.identity.email.EntityEmailBo; 006import org.kuali.rice.kim.impl.identity.name.EntityNameBo; 007import org.kuali.rice.kim.impl.identity.phone.EntityPhoneBo; 008import org.kuali.rice.krad.service.BusinessObjectService; 009import org.kuali.rice.krad.service.KRADServiceLocator; 010 011import java.util.Arrays; 012 013/** 014 * Created with IntelliJ IDEA. 015 * User: ? 016 * Date: 5/23/12 017 * Time: 3:16 PM 018 * To change this template use File | Settings | File Templates. 019 */ 020 021public enum OlePatronDocumentFixture { 022 PATRON_DOC(),; 023 private BusinessObjectService businessObjectService; 024 025 private OlePatronDocumentFixture() { } 026 public OlePatronDocument createPatron() { 027 businessObjectService = KRADServiceLocator.getBusinessObjectService(); 028 OlePatronDocument patronDocument = new OlePatronDocument(); 029 EntityNameBo entityNameBo = new EntityNameBo(); 030 entityNameBo.setNameCode("PRFR"); 031 entityNameBo.setFirstName("mockFirstName"); 032 entityNameBo.setLastName("mockLastName"); 033 034 EntityAddressBo entityAddressBo = new EntityAddressBo(); 035 entityAddressBo.setLine1("mockLine1"); 036 entityAddressBo.setLine2("mockLine2"); 037 entityAddressBo.setAddressTypeCode("HM"); 038 entityAddressBo.setStateProvinceCode("IL"); 039 040 EntityEmailBo entityEmailBo = new EntityEmailBo(); 041 entityEmailBo.setEmailTypeCode("HM"); 042 entityEmailBo.setEmailAddress("test@mock"); 043 044 EntityPhoneBo entityPhoneBo = new EntityPhoneBo(); 045 entityPhoneBo.setPhoneNumber("987654321"); 046 entityPhoneBo.setCountryCode("US"); 047 entityPhoneBo.setPhoneTypeCode("MBL"); 048 049 OlePatronDocument olePatron= new OlePatronDocument(); 050 olePatron.setBarcode("mockBarcode"); 051 052 olePatron.setName(entityNameBo); 053 olePatron.setAddresses(Arrays.asList(entityAddressBo)); 054 olePatron.setEmails(Arrays.asList(entityEmailBo)); 055 olePatron.setPhones(Arrays.asList(entityPhoneBo)); 056 return patronDocument; 057 } 058 059}