Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAllowAllAccessIfAuthenticationIsDisabled() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAllowAllAccessIfAuthenticationIsDisabled()
        {
            // Given
            StartServer(false);

            // When & then
            assertEquals(201, HTTP.POST(Server.baseUri().resolve("db/data/node").ToString(), HTTP.RawPayload.quotedJson("{'name':'jake'}")).status());
            assertEquals(404, HTTP.GET(Server.baseUri().resolve("db/data/node/1234").ToString()).status());
            assertEquals(200, HTTP.POST(Server.baseUri().resolve("db/data/transaction/commit").ToString(), HTTP.RawPayload.quotedJson("{'statements':[{'statement':'MATCH (n) RETURN n'}]}")).status());
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnEmptyMapForEmptyProperties()
        public virtual void ShouldReturnEmptyMapForEmptyProperties()
        {
            // Given
            string location = HTTP.POST(Server().baseUri().resolve("db/data/node").ToString()).location();

            // When
            HTTP.Response res = HTTP.GET(location + "/properties");

            // Then
            assertThat(res.RawContent(), equalTo("{ }"));
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void runningInCompiledRuntime()
        public virtual void RunningInCompiledRuntime()
        {
            // Given
            string uri     = FunctionalTestHelper.dataUri() + "transaction/commit";
            string payload = "{ 'statements': [ { 'statement': 'CYPHER runtime=compiled MATCH (n) RETURN n' } ] }";

            // When
            HTTP.Response res = HTTP.POST(uri, payload.replaceAll("'", "\""));

            // Then
            assertEquals(200, res.Status());
        }
Ejemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAllowDisablingAuthorization() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAllowDisablingAuthorization()
        {
            // Given
            _server = CommunityServerBuilder.serverOnRandomPorts().withProperty(GraphDatabaseSettings.auth_enabled.name(), "false").build();

            // When
            _server.start();

            // Then I should have write access
            HTTP.Response response = HTTP.POST(_server.baseUri().resolve("db/data/node").ToString(), quotedJson("{'name':'My Node'}"));
            assertThat(response.Status(), equalTo(201));
            string node = response.Location();

            // Then I should have read access
            assertThat(HTTP.GET(node).status(), equalTo(200));
        }