@Test(expectedExceptions = IllegalArgumentException.class) public void testNullDateForTimestamp() { new PromotionStatusBuilder(null).timestampDate(null); }
public PromotionStatusBuilder timestampDate(Date timestampDate) { if (timestampDate == null) { throw new IllegalArgumentException("Cannot format a null date."); } this.timestamp = new SimpleDateFormat(Build.STARTED_FORMAT).format(timestampDate); return this; }
PromotionStatusBuilder { public PromotionStatusBuilder timestampDate(Date timestampDate) { if (timestampDate == null) { throw new IllegalArgumentException("Cannot format a null date."); } this.timestamp = new SimpleDateFormat(Build.STARTED_FORMAT).format(timestampDate); return this; } }
PromotionStatusBuilder { public PromotionStatusBuilder timestampDate(Date timestampDate) { if (timestampDate == null) { throw new IllegalArgumentException("Cannot format a null date."); } this.timestamp = new SimpleDateFormat(Build.STARTED_FORMAT).format(timestampDate); return this; } PromotionStatusBuilder(String status); }
PromotionStatusBuilder { public PromotionStatusBuilder timestampDate(Date timestampDate) { if (timestampDate == null) { throw new IllegalArgumentException("Cannot format a null date."); } this.timestamp = new SimpleDateFormat(Build.STARTED_FORMAT).format(timestampDate); return this; } PromotionStatusBuilder(String status); PromotionStatusBuilder comment(String comment); PromotionStatusBuilder repository(String repository); PromotionStatusBuilder timestamp(String timestamp); PromotionStatusBuilder timestampDate(Date timestampDate); PromotionStatusBuilder user(String user); PromotionStatusBuilder ciUser(String ciUser); PromotionStatus build(); }
PromotionStatusBuilder { public PromotionStatusBuilder timestampDate(Date timestampDate) { if (timestampDate == null) { throw new IllegalArgumentException("Cannot format a null date."); } this.timestamp = new SimpleDateFormat(Build.STARTED_FORMAT).format(timestampDate); return this; } PromotionStatusBuilder(String status); PromotionStatusBuilder comment(String comment); PromotionStatusBuilder repository(String repository); PromotionStatusBuilder timestamp(String timestamp); PromotionStatusBuilder timestampDate(Date timestampDate); PromotionStatusBuilder user(String user); PromotionStatusBuilder ciUser(String ciUser); PromotionStatus build();  }