Unit tests for restrictions types and proper escaping. Change-Id: Iac35521faf5798398a89fecbad82fcdd256a4146