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