Created
June 9, 2012 21:58
-
-
Save sandromancuso/2902728 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.craftedsw.testingbuilders; | |
public class TradeBuilder { | |
private String inboundMessage; | |
private ReportabilityDecision reportabilityDecision; | |
public static TradeBuilder aTrade() { | |
return new TradeBuilder(); | |
} | |
public TradeBuilder withInboundMessage(String inboundMessage) { | |
this.inboundMessage = inboundMessage; | |
return this; | |
} | |
public TradeBuilder withReportabilityDecision(ReportabilityDecision reportabilityDecision) { | |
this.reportabilityDecision = reportabilityDecision; | |
return this; | |
} | |
public Trade build() { | |
Trade trade = createTrade(); | |
trade.setInboundMessage(inboundMessage); | |
trade.setReportabilityDecision(reportabilityDecision); | |
return trade; | |
} | |
Trade createTrade() { | |
return new Trade(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment