@Test
public void testModifyAttributesWithDirContextOperationsNotInitializedDn() throws Exception {

	when(dirContextOperationsMock.getDn()).thenReturn(LdapUtils.emptyLdapName());
	when(dirContextOperationsMock.isUpdateMode()).thenReturn(false);
	LdapTemplate tested = new LdapTemplate() {
		public void modifyAttributes(Name dn, ModificationItem[] mods) {
			fail("The call to the base modifyAttributes should not have occured.");
		}
	};
	try {
		tested.modifyAttributes(dirContextOperationsMock);
		fail("IllegalStateException expected");
	}
	catch (IllegalStateException expected) {
		assertThat(true).isTrue();
	}
}