Unit tests for template adaptation

Change-Id: Iae81eefd668ba4cd0a241f5791cfe901113d75d8