LdapTransactionUtils { public static boolean isSupportedWriteTransactionOperation(String methodName) { return (ObjectUtils.nullSafeEquals(methodName, BIND_METHOD_NAME) || ObjectUtils.nullSafeEquals(methodName, REBIND_METHOD_NAME) || ObjectUtils.nullSafeEquals(methodName, RENAME_METHOD_NAME) || ObjectUtils.nullSafeEquals(methodName, MODIFY_ATTRIBUTES_METHOD_NAME) || ObjectUtils.nullSafeEquals(methodName, UNBIND_METHOD_NAME)); } private  LdapTransactionUtils(); static Name getFirstArgumentAsName(Object[] args); static Name getArgumentAsName(Object arg); static boolean isSupportedWriteTransactionOperation(String methodName); static final String REBIND_METHOD_NAME; static final String BIND_METHOD_NAME; static final String RENAME_METHOD_NAME; static final String UNBIND_METHOD_NAME; static final String MODIFY_ATTRIBUTES_METHOD_NAME; }
@Test public void testIsSupportedWriteTransactionOperation() { assertTrue(LdapTransactionUtils .isSupportedWriteTransactionOperation("bind")); assertTrue(LdapTransactionUtils .isSupportedWriteTransactionOperation("rebind")); assertTrue(LdapTransactionUtils .isSupportedWriteTransactionOperation("unbind")); assertTrue(LdapTransactionUtils .isSupportedWriteTransactionOperation("modifyAttributes")); assertTrue(LdapTransactionUtils .isSupportedWriteTransactionOperation("rename")); assertFalse(LdapTransactionUtils .isSupportedWriteTransactionOperation("lookup")); assertFalse(LdapTransactionUtils .isSupportedWriteTransactionOperation("search")); }