@Test
public void testBindApplication_invalidBoundTemplate() throws Exception {

	TestApplication app2 = new TestApplication();
	app2.setDirectory( this.folder.newFolder());
	app2.getTemplate().setName( "tpl-other" );
	app2.setName( "app-other" );
	this.managerWrapper.addManagedApplication( new ManagedApplication( app2 ));
	// ma and app2 do not have the same template name
	Response resp = this.resource.bindApplication( this.ma.getName(), this.ma.getApplication().getTemplate().getName(), app2.getName());
	Assert.assertEquals( Status.FORBIDDEN.getStatusCode(), resp.getStatus());
	Assert.assertEquals( 0, this.msgClient.allSentMessages.size());
}