//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void begin__commit_with_malformed_json() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void Begin_CommitWithMalformedJson() { long nodesInDatabaseBeforeTransaction = CountNodes(); // begin HTTP.Response begin = POST(TxUri(), quotedJson("{ 'statements': [ { 'statement': 'CREATE (n)' } ] }")); string commitResource = begin.StringFromContent("commit"); // commit with malformed json HTTP.Response response = POST(commitResource, rawPayload("[{asd,::}]")); assertThat(response.Status(), @is(200)); assertThat(response, hasErrors(InvalidFormat)); assertThat(CountNodes(), equalTo(nodesInDatabaseBeforeTransaction)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void begin__commit_with_invalid_cypher() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void Begin_CommitWithInvalidCypher() { long nodesInDatabaseBeforeTransaction = CountNodes(); // begin HTTP.Response response = POST(TxUri(), quotedJson("{ 'statements': [ { 'statement': 'CREATE (n)' } ] }")); string commitResource = response.StringFromContent("commit"); // commit with invalid cypher response = POST(commitResource, quotedJson("{ 'statements': [ { 'statement': 'CREATE ;;' } ] }")); assertThat(response.Status(), @is(200)); assertThat(response, hasErrors(SyntaxError)); assertThat(response, containsNoStackTraces()); assertThat(CountNodes(), equalTo(nodesInDatabaseBeforeTransaction)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void clientErrorShouldRollbackTheTransaction() throws org.neo4j.server.rest.domain.JsonParseException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ClientErrorShouldRollbackTheTransaction() { // Given HTTP.Response first = POST(TxUri(), quotedJson("{'statements': [{'statement': 'CREATE (n {prop : 1})'}]}")); assertThat(first.Status(), @is(201)); assertThat(first, containsNoErrors()); long txId = ExtractTxId(first); // When HTTP.Response malformed = POST(TxUri(txId), quotedJson("{'statements': [{'statement': '" + Query + "'}]}")); // Then // malformed POST contains expected error assertThat(malformed.Status(), @is(200)); assertThat(malformed, hasErrors(ErrorStatus)); // transaction was rolled back on the previous step and we can't commit it HTTP.Response commit = POST(first.StringFromContent("commit")); assertThat(commit.Status(), @is(404)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private static void commit(org.neo4j.test.server.HTTP.Response tx, org.neo4j.test.server.HTTP.Builder http) throws org.neo4j.server.rest.domain.JsonParseException private static void Commit(HTTP.Response tx, HTTP.Builder http) { http.Post(tx.StringFromContent("commit")); }