@Test( expected = UnauthorizedActionException.class )
public void testReplaceApplicationBindings_failure_invalidTemplate() throws Exception {

	TestApplication app1 = new TestApplication();
	app1.setDirectory( this.folder.newFolder());
	app1.getTemplate().setExternalExportsPrefix( "prefix1" );
	ManagedApplication ma1 = new ManagedApplication( app1 );
	TestManagerWrapper.addManagedApplication( this.mngr, ma1 );
	TestApplication app2 = new TestApplication();
	app2.setDirectory( this.folder.newFolder());
	ManagedApplication ma2 = new ManagedApplication( app2 );
	TestManagerWrapper.addManagedApplication( this.mngr, ma2 );
	Assert.assertEquals( 0, ma1.getApplication().getApplicationBindings().size());
	Mockito.verifyZeroInteractions( this.messagingMngr );
	this.mngr.replaceApplicationBindings( ma1, "prefix1", new HashSet<>( Arrays.asList( ma2.getName())));
}