ClearChargingProfileRequest implements Request { @XmlElement public void setStackLevel(Integer stackLevel) { if (stackLevel != null && stackLevel < 0) { throw new PropertyConstraintException(stackLevel, "stackLevel must be >= 0"); } this.stackLevel = stackLevel; }  Integer getId(); @XmlElement void setId(Integer id); Integer getConnectorId(); @XmlElement void setConnectorId(Integer connectorId); ChargingProfilePurposeType getChargingProfilePurpose(); @XmlElement void setChargingProfilePurpose(ChargingProfilePurposeType chargingProfilePurpose); Integer getStackLevel(); @XmlElement void setStackLevel(Integer stackLevel); @Override boolean transactionRelated(); @Override boolean validate(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void setStackLevel_outOfBounderies_throwsPropertyConstraintException() { thrownException.expect(instanceOf(PropertyConstraintException.class)); thrownException.expectMessage( equalTo("Validation failed: [stackLevel must be >= 0]. Current Value: [-1]")); Integer illegalValue = -1; request.setStackLevel(illegalValue); }