Project: mule
Issue MULE-8574: DataType does not validates encoding
When setting the encoding in payload, transformers, properties and variables with an incorrect value it is not validated. In the other hand the mimeType throws an exception. I think that the encoding should have the same behaviour. When you set the property "ContentType" it let you use any value in both mimeType and encoding. But maybe in the content type situation is the desired behaviour. Steps to reproduce (see attached app): Set Payload: 1) Send HTTP request to http://localhost:8081/encoding_not_throw_exception : There the first set payload set the encoding with an invalid value but as then there is another set payload that set the encoding to a valid encoding there is not exception. 2) Send HTTP request to http://localhost:8081/encoding_throw_exception : Here the Set Payload set an invalid encoding value and it throws "java.io.UnsupportedEncodingException". Properties: 1) Send HTTP request to http://localhost:8081/encoding_not_throw_exception_in_properties : 2) Set property sets the encoding with a wrong value. In the check in the Outbound Property log: OUTBOUND scoped properties: pepe=2 pepe-DataType=SimpleDataType{type=java.lang.Integer, mimeType='text/plain', encoding='qwd'}
Story points: 5