package example;

import org.junit.Rule;
import org.junit.Test;

import org.neo4j.driver.v1.*;
import org.neo4j.harness.junit.Neo4jRule;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.*;
import static org.neo4j.driver.v1.Values.parameters;

public class DegreeTest {
    // This rule starts a Neo4j instance
    @Rule
    public Neo4jRule neo4j = new Neo4jRule()

            // This is the function we want to test
            .withFunction(Degree.class);

    @Test
    public void shouldCalculateDegree() throws Throwable {
        // In a try-block, to make sure we close the driver and session after the test
        try (
                Driver driver = GraphDatabase.driver(
                        neo4j.boltURI(),
                        Config.build().withEncryptionLevel(Config.EncryptionLevel.NONE).toConfig()
                );
                Session session = driver.session()
        ) {
            String label = "User";
            session.run("CREATE (p:User {name:'Brookreson'})", parameters("label", label));

            StatementResult result1 = session.run("CALL example.degree('{label}')", parameters("label", label));

            assertThat(result1.single().get("degree").asInt(), equalTo(0));
        }
    }
}
@@ -217,61 +217,8 @@
 t.*;
-%0Aimport static org.neo4j.driver.v1.Values.parameters;
 %0A%0Apu
@@ -340,87 +340,22 @@
 le()
-%0A%0A            // This is the function we want to test%0A            .withFunction
+.withProcedure
 (Deg
@@ -817,43 +817,8 @@
 ) %7B%0A
-            String label = %22User%22;%0A
     
@@ -878,36 +878,8 @@
 '%7D)%22
-, parameters(%22label%22, label)
 );%0A%0A
@@ -954,46 +954,15 @@
 ee('
-%7Blabel%7D')%22, parameters(%22label%22, label)
+User')%22
 );%0A%0A

Fix error with DegreeTest