//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldBeAbleToActOnSessionWhenUpdatingCredentials() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldBeAbleToActOnSessionWhenUpdatingCredentials() { BoltStateMachine machine = Env.newMachine(_boltChannel); BoltResponseRecorder recorder = new BoltResponseRecorder(); // when InitMessage message = new InitMessage(USER_AGENT, map("scheme", "basic", "principal", "neo4j", "credentials", UTF8.encode("neo4j"), "new_credentials", UTF8.encode("secret"))); machine.Process(message, recorder); machine.Process(new RunMessage("CREATE ()", EMPTY_MAP), recorder); // then assertThat(recorder.NextResponse(), succeeded()); assertThat(recorder.NextResponse(), succeeded()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGiveKernelVersionOnInit() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldGiveKernelVersionOnInit() { // Given it is important for client applications to programmatically // identify expired credentials as the cause of not being authenticated BoltStateMachine machine = Env.newMachine(_boltChannel); BoltResponseRecorder recorder = new BoltResponseRecorder(); string version = "Neo4j/" + Version.Neo4jVersion; // When InitMessage init = new InitMessage(USER_AGENT, newBasicAuthToken("neo4j", "neo4j")); machine.Process(init, recorder); machine.Process(new RunMessage("CREATE ()", EMPTY_MAP), recorder); // Then assertThat(recorder.NextResponse(), succeededWithMetadata("server", stringValue(version))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGiveCredentialsExpiredStatusOnExpiredCredentials() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldGiveCredentialsExpiredStatusOnExpiredCredentials() { // Given it is important for client applications to programmatically // identify expired credentials as the cause of not being authenticated BoltStateMachine machine = Env.newMachine(_boltChannel); BoltResponseRecorder recorder = new BoltResponseRecorder(); // When InitMessage init = new InitMessage(USER_AGENT, newBasicAuthToken("neo4j", "neo4j")); machine.Process(init, recorder); machine.Process(new RunMessage("CREATE ()", EMPTY_MAP), recorder); // Then assertThat(recorder.NextResponse(), succeededWithMetadata("credentials_expired", TRUE)); assertThat(recorder.NextResponse(), failedWithStatus(Org.Neo4j.Kernel.Api.Exceptions.Status_Security.CredentialsExpired)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private static void runBegin(org.neo4j.bolt.runtime.BoltStateMachine machine) throws org.neo4j.bolt.runtime.BoltConnectionFatality private static void RunBegin(BoltStateMachine machine) { machine.Process(new RunMessage("BEGIN", EmptyParams), nullResponseHandler()); machine.Process(DiscardAllMessage.INSTANCE, nullResponseHandler()); assertThat(machine, hasTransaction()); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private static org.neo4j.bolt.runtime.BoltStateMachine init(org.neo4j.bolt.runtime.BoltStateMachine machine, String owner) throws org.neo4j.bolt.security.auth.AuthenticationException, org.neo4j.bolt.runtime.BoltConnectionFatality private static BoltStateMachine Init(BoltStateMachine machine, string owner) { machine.Process(new InitMessage(USER_AGENT, string.ReferenceEquals(owner, null) ? emptyMap() : singletonMap(Org.Neo4j.Kernel.api.security.AuthToken_Fields.PRINCIPAL, owner)), nullResponseHandler()); return(machine); }