View Javadoc

1   package org.kuali.ole;
2   
3   /**
4    * Created by IntelliJ IDEA.
5    * User: palanivel
6    * Date: 3/8/12
7    * Time: 6:56 PM
8    * To change this template use File | Settings | File Templates.
9    */
10  import org.kuali.ole.pojo.edi.PartyDetails;
11  
12  public enum PartyDetailsFixture {
13      PartyDetails("API",
14                   "DUL-WCS"
15      ),;
16  
17      private String additionalPartyIdentification;
18      private String partyName;
19  
20      private PartyDetailsFixture(String additionalPartyIdentification,String partyName){
21             this.additionalPartyIdentification = additionalPartyIdentification;
22             this.partyName = partyName;
23      }
24  
25      public PartyDetails createPartyDetails(Class clazz){
26          PartyDetails partyDetails = null;
27          try{
28              partyDetails = (PartyDetails)clazz.newInstance();
29          }catch (InstantiationException e){
30              throw new RuntimeException("PartyDetails creation failed. class = " + clazz);
31          } catch (IllegalAccessException e) {
32              throw new RuntimeException("PartyDetails creation failed. class = " + clazz);
33          }
34          partyDetails.setAdditionalPartyIdentification(additionalPartyIdentification);
35          partyDetails.setPartyName(partyName);
36  
37          return partyDetails;
38      }
39  }