@Test public void ensureCorrectExceptionThrownOnEmptyPayload() { Event event = new Event(); exception.expect(IllegalArgumentException.class); event.setPayload(Event.Payload.valueOf(null)); }
public void setPayload(Payload value) { if (value == null || value.toString() == null) { throw new IllegalArgumentException("Invalid value for payload. Payload should not be null."); } else if (value.toString().length() > 4096) { throw new IllegalArgumentException( String.format("Invalid value for payload \"%s\". Payload should be 4096 characters or less", value)); } payload = value; }
Event implements Cloneable { public void setPayload(Payload value) { if (value == null || value.toString() == null) { throw new IllegalArgumentException("Invalid value for payload. Payload should not be null."); } else if (value.toString().length() > 4096) { throw new IllegalArgumentException( String.format("Invalid value for payload \"%s\". Payload should be 4096 characters or less", value)); } payload = value; } }
Event implements Cloneable { public void setPayload(Payload value) { if (value == null || value.toString() == null) { throw new IllegalArgumentException("Invalid value for payload. Payload should not be null."); } else if (value.toString().length() > 4096) { throw new IllegalArgumentException( String.format("Invalid value for payload \"%s\". Payload should be 4096 characters or less", value)); } payload = value; }  }
Event implements Cloneable { public void setPayload(Payload value) { if (value == null || value.toString() == null) { throw new IllegalArgumentException("Invalid value for payload. Payload should not be null."); } else if (value.toString().length() > 4096) { throw new IllegalArgumentException( String.format("Invalid value for payload \"%s\". Payload should be 4096 characters or less", value)); } payload = value; }  Date getTimestamp(); void setTimestamp(Date value); Type getType(); Event.Name getName(); void setName(Event.Name value); Context getContext(); void setContext(Context value); Payload getPayload(); void setPayload(Payload value); String getValue(); void setValue(String value); @Override int hashCode(); @Override boolean equals(Object obj); @Override Event clone(); @Override String toString(); }
Event implements Cloneable { public void setPayload(Payload value) { if (value == null || value.toString() == null) { throw new IllegalArgumentException("Invalid value for payload. Payload should not be null."); } else if (value.toString().length() > 4096) { throw new IllegalArgumentException( String.format("Invalid value for payload \"%s\". Payload should be 4096 characters or less", value)); } payload = value; }  Date getTimestamp(); void setTimestamp(Date value); Type getType(); Event.Name getName(); void setName(Event.Name value); Context getContext(); void setContext(Context value); Payload getPayload(); void setPayload(Payload value); String getValue(); void setValue(String value); @Override int hashCode(); @Override boolean equals(Object obj); @Override Event clone(); @Override String toString(); static final String IMPRESSION; }