001package org.kuali.ole; 002 003/** 004 * Created by IntelliJ IDEA. 005 * User: palanivel 006 * Date: 3/8/12 007 * Time: 6:56 PM 008 * To change this template use File | Settings | File Templates. 009 */ 010 011import org.kuali.ole.pojo.edi.PartyDetails; 012 013public enum PartyDetailsFixture { 014 PartyDetails("API", 015 "DUL-WCS" 016 ),; 017 018 private String additionalPartyIdentification; 019 private String partyName; 020 021 private PartyDetailsFixture(String additionalPartyIdentification, String partyName) { 022 this.additionalPartyIdentification = additionalPartyIdentification; 023 this.partyName = partyName; 024 } 025 026 public PartyDetails createPartyDetails(Class clazz) { 027 PartyDetails partyDetails = null; 028 try { 029 partyDetails = (PartyDetails) clazz.newInstance(); 030 } catch (InstantiationException e) { 031 throw new RuntimeException("PartyDetails creation failed. class = " + clazz); 032 } catch (IllegalAccessException e) { 033 throw new RuntimeException("PartyDetails creation failed. class = " + clazz); 034 } 035 partyDetails.setAdditionalPartyIdentification(additionalPartyIdentification); 036 partyDetails.setPartyName(partyName); 037 038 return partyDetails; 039 } 040}