Skip to content

Commit

Permalink
Fixed test and improved style
Browse files Browse the repository at this point in the history
  • Loading branch information
eebus committed Mar 6, 2017
1 parent 9b5e738 commit 784c40e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
Expand Up @@ -100,7 +100,6 @@ public void shouldFailNicelyWhenUnknownAPI() throws Throwable


// Then // Then
compiler.compileProcedure( ProcedureWithUnknownAPI.class, Optional.empty(), true ); compiler.compileProcedure( ProcedureWithUnknownAPI.class, Optional.empty(), true );

} }


@Test @Test
Expand Down Expand Up @@ -142,7 +141,6 @@ public void shouldFailNicelyWhenUnsafeAPISafeMode() throws Throwable
"org.neo4j.kernel.impl.proc.listCoolPeople is not " + "org.neo4j.kernel.impl.proc.listCoolPeople is not " +
"available due to not having unrestricted access rights, check configuration." ) ); "available due to not having unrestricted access rights, check configuration." ) );
} }

} }


@Test @Test
Expand Down Expand Up @@ -170,7 +168,6 @@ public void shouldFailNicelyWhenFunctionUsesUnknownAPI() throws Throwable


// Then // Then
compiler.compileFunction( FunctionWithUnknownAPI.class ); compiler.compileFunction( FunctionWithUnknownAPI.class );

} }


@Test @Test
Expand All @@ -195,7 +192,6 @@ public void shouldFailNicelyWhenUnsafeAPISafeModeFunction() throws Throwable
"org.neo4j.kernel.impl.proc.listCoolPeople is not " + "org.neo4j.kernel.impl.proc.listCoolPeople is not " +
"available due to not having unrestricted access rights, check configuration." ) ); "available due to not having unrestricted access rights, check configuration." ) );
} }

} }


@Test @Test
Expand Down Expand Up @@ -224,7 +220,6 @@ public void shouldFailNicelyWhenAggregationFunctionUsesUnknownAPI() throws Throw


// Then // Then
compiler.compileAggregationFunction( AggregationFunctionWithUnknownAPI.class ); compiler.compileAggregationFunction( AggregationFunctionWithUnknownAPI.class );

} }


@Test @Test
Expand All @@ -250,7 +245,6 @@ public void shouldFailNicelyWhenUnsafeAPISafeModeAggregationFunction() throws Th
"org.neo4j.kernel.impl.proc.listCoolPeople is not " + "org.neo4j.kernel.impl.proc.listCoolPeople is not " +
"available due to not having unrestricted access rights, check configuration." ) ); "available due to not having unrestricted access rights, check configuration." ) );
} }

} }


@Test @Test
Expand All @@ -266,7 +260,7 @@ public void shouldFailNicelyWhenAllUsesUnsafeAPI() throws Throwable
.warn( "org.neo4j.kernel.impl.proc.listCoolPeople is not " + .warn( "org.neo4j.kernel.impl.proc.listCoolPeople is not " +
"available due to not having unrestricted access rights, check configuration." ); "available due to not having unrestricted access rights, check configuration." );
verify( log ) verify( log )
.warn( "org.neo4j.kernel.impl.proc.safeUserFunctionInUnknownAPIClass is not " + .warn( "org.neo4j.kernel.impl.proc.safeUserFunctionInUnsafeAPIClass is not " +
"available due to not having unrestricted access rights, check configuration." ); "available due to not having unrestricted access rights, check configuration." );
verify( log ) verify( log )
.warn( "org.neo4j.kernel.impl.proc.listCoolPeopleProcedure is not " + .warn( "org.neo4j.kernel.impl.proc.listCoolPeopleProcedure is not " +
Expand Down Expand Up @@ -510,10 +504,9 @@ public Stream<MyOutputRecord> listCoolPeopleProcedure()
} }


@UserFunction @UserFunction
public String safeUserFunctionInUnknownAPIClass() public String safeUserFunctionInUnsafeAPIClass()
{ {
return "a safe function"; return "a safe function";
} }
} }

} }
Expand Up @@ -1148,7 +1148,6 @@ public void setUp() throws IOException
db = new TestGraphDatabaseFactory() db = new TestGraphDatabaseFactory()
.newImpermanentDatabaseBuilder() .newImpermanentDatabaseBuilder()
.setConfig( plugin_dir, plugins.getRoot().getAbsolutePath() ) .setConfig( plugin_dir, plugins.getRoot().getAbsolutePath() )
.setConfig( GraphDatabaseSettings.procedure_unrestricted, "*" )
.newGraphDatabase(); .newGraphDatabase();
} }


Expand Down Expand Up @@ -1290,9 +1289,6 @@ public static class ClassWithProcedures
@Context @Context
public ProcedureTransaction procedureTransaction; public ProcedureTransaction procedureTransaction;


@Context
public GraphDatabaseAPI graphDatabaseAPI;

@Procedure @Procedure
public Stream<Output> guardMe() public Stream<Output> guardMe()
{ {
Expand Down Expand Up @@ -1648,11 +1644,8 @@ public void schemaTryingToWrite()


public static class ClassWithFunctions public static class ClassWithFunctions
{ {
@Context
public GraphDatabaseAPI graphDatabaseAPI;

@UserFunction() @UserFunction()
public String getNodeName( @Name( value = "node", defaultValue = "null") Node node ) public String getNodeName( @Name( value = "node", defaultValue = "null" ) Node node )
{ {
return "nodeName"; return "nodeName";
} }
Expand Down

0 comments on commit 784c40e

Please sign in to comment.