Skip to content

Instantly share code, notes, and snippets.

@sandromancuso
Created June 9, 2012 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandromancuso/2902728 to your computer and use it in GitHub Desktop.
Save sandromancuso/2902728 to your computer and use it in GitHub Desktop.
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