//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGetEmptyUsernameForAnonymousContext() public virtual void ShouldGetEmptyUsernameForAnonymousContext() { when(_transaction.securityContext()).thenReturn(AnonymousContext.read().authorize(s => - 1, GraphDatabaseSettings.DEFAULT_DATABASE_NAME)); TxStateTransactionDataSnapshot transactionDataSnapshot = Snapshot(); assertEquals("", transactionDataSnapshot.Username()); }
protected internal override long FetchNext() { Ktx.assertOpen(); while (Cursor.next()) { long reference = Cursor.relationshipReference(); if (Ktx.dataRead().relationshipExists(reference)) { return(reference); } else if (Ktx.securityContext().mode().allowsWrites()) { //remove it from index so it doesn't happen again try { RELATIONSHIP.remove(Ktx.indexWrite(), Name, reference); } catch (Exception e) when(e is ExplicitIndexNotFoundKernelException || e is InvalidTransactionTypeKernelException) { //ignore } } } Close(); return(NO_ID); }
public override SecurityContext SecurityContext() { return(_transaction.securityContext()); }
public override SecurityContext SecurityContext() { return(Internal.securityContext()); }