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

            HTTP.Response response = RunQuery("authDisabled", "authDisabled");

            assertEquals(OK.StatusCode, response.Status());
            AssertCorsHeaderPresent(response);
            assertThat(response.Content().ToString(), containsString("42"));
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAddCorsHeaderWhenAuthEnabledAndPasswordChangeRequired() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAddCorsHeaderWhenAuthEnabledAndPasswordChangeRequired()
        {
            StartServer(true);

            HTTP.Response response = RunQuery("neo4j", "neo4j");

            assertEquals(FORBIDDEN.StatusCode, response.Status());
            AssertCorsHeaderPresent(response);
            assertThat(response.Content().ToString(), containsString("password_change"));
        }
Example #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAddCorsHeaderWhenAuthEnabledAndIncorrectPassword() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAddCorsHeaderWhenAuthEnabledAndIncorrectPassword()
        {
            StartServer(true);

            HTTP.Response response = RunQuery("neo4j", "wrongPassword");

            assertEquals(UNAUTHORIZED.StatusCode, response.Status());
            AssertCorsHeaderPresent(response);
            assertThat(response.Content().ToString(), containsString("Neo.ClientError.Security.Unauthorized"));
        }
Example #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAddCorsHeaderWhenAuthEnabledAndPasswordChangeNotRequired() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAddCorsHeaderWhenAuthEnabledAndPasswordChangeNotRequired()
        {
            StartServer(true);
            HTTP.Response passwordChangeResponse = ChangePassword("neo4j", "neo4j", "newPassword");
            assertEquals(OK.StatusCode, passwordChangeResponse.Status());
            AssertCorsHeaderPresent(passwordChangeResponse);

            HTTP.Response queryResponse = RunQuery("neo4j", "newPassword");

            assertEquals(OK.StatusCode, queryResponse.Status());
            AssertCorsHeaderPresent(queryResponse);
            assertThat(queryResponse.Content().ToString(), containsString("42"));
        }