{"id":13529787,"url":"https://github.com/graphaware/neo4j-resttest","last_synced_at":"2025-04-01T17:30:59.907Z","repository":{"id":17955080,"uuid":"20940842","full_name":"graphaware/neo4j-resttest","owner":"graphaware","description":"Library for testing Neo4j code over REST","archived":true,"fork":false,"pushed_at":"2020-11-14T14:37:42.000Z","size":202,"stargazers_count":13,"open_issues_count":1,"forks_count":5,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-08-02T07:10:40.633Z","etag":null,"topics":["java","neo4j","neo4j-graphaware-framework"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphaware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-17T21:55:25.000Z","updated_at":"2023-01-28T09:08:43.000Z","dependencies_parsed_at":"2022-09-02T07:01:46.341Z","dependency_job_id":null,"html_url":"https://github.com/graphaware/neo4j-resttest","commit_stats":null,"previous_names":[],"tags_count":88,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-resttest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-resttest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-resttest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-resttest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphaware","download_url":"https://codeload.github.com/graphaware/neo4j-resttest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222748137,"owners_count":17031897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","neo4j","neo4j-graphaware-framework"],"created_at":"2024-08-01T07:00:39.408Z","updated_at":"2024-11-02T16:31:11.656Z","avatar_url":"https://github.com/graphaware.png","language":"Java","funding_links":[],"categories":["Extensions","REST API"],"sub_categories":["REST API","Other"],"readme":"GraphAware Neo4j RestTest - RETIRED\n===================================\n\n## RestTest Has Been Retired\nAs of April 2020, this module is retiring. This means it will no longer be maintained and released together with new versions of the GraphAware Framework and Neo4j. The last compatible Neo4j version is 3.5.14.\n\nCustom REST APIs on top of Neo4j have been practically replaced by Cypher User Functions and Procedures. If you need functionality similar to what RestTest provided, go ahead and write a procedure that uses [GraphUnit](https://github.com/graphaware/neo4j-framework/blob/master/tests/src/main/java/com/graphaware/test/unit/GraphUnit.java).  \n\nThis repository will remain public.\n\n## Introduction\n\nGraphAware RestTest is a simple library for testing code that talks to Neo4j running in \u003ca href=\"http://docs.neo4j.org/chunked/stable/server-installation.html\" target=\"_blank\"\u003estandalone server\u003c/a\u003e mode.\n\nGetting the Software\n--------------------\n\nYou will need the \u003ca href=\"https://github.com/graphaware/neo4j-framework\" target=\"_blank\"\u003eGraphAware Neo4j Framework\u003c/a\u003e and GraphAware Neo4j RestTest .jar files (both of which you can \u003ca href=\"http://graphaware.com/downloads/\" target=\"_blank\"\u003edownload here\u003c/a\u003e) dropped\ninto the `plugins` directory of your Neo4j installation.\nFor the framework to work, you need to adjust your neo4j configuration as described in the \u003ca href=\"https://github.com/graphaware/neo4j-framework#server-mode\"\u003eframework installation instructions\u003c/a\u003e.\nAfter Neo4j restart, you will be able to use the RestTest APIs.\n\nReleases are synced to \u003ca href=\"http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22resttest%22\" target=\"_blank\"\u003eMaven Central repository\u003c/a\u003e.\n\n#### Note on Versioning Scheme\n\nThe version number has two parts. The first four numbers indicate compatibility with Neo4j GraphAware Framework.\n The last number is the version of the RestTest library. For example, version 2.1.2.7.2 is version 2 of RestTest\n compatible with GraphAware Neo4j Framework 2.1.2.7.\n\nUsing GraphAware RestTest\n-------------------------\n\nRestTest allows you to assert the state of the database running in server mode and to clear it. It is in a sense equivalent\nto using \u003ca href=\"http://graphaware.com/neo4j/2014/05/29/graph-unit-neo4j-unit-testing.html\" target=\"_blank\"\u003eGraphUnit\u003c/a\u003e in\nembedded mode.\n\n### REST API\n\nWhen deployed in server mode, there are three URLs that you can issue POST requests to:\n* `http://your-server-address:7474/graphaware/resttest/clear` to clear your database. No body required.\n* `http://your-server-address:7474/graphaware/resttest/assertSameGraph` to assert the state of the database. You need to provide a body described shortly.\n* `http://your-server-address:7474/graphaware/resttest/assertSubgraph` to assert the state of the database. You need to provide a body described shortly.\n* `http://your-server-address:7474/graphaware/resttest/assertEmpty` to assert the database is empty. You need to provide a body described shortly.\n\nThe body where required needs to provide a Cypher CREATE statement, representing the state of the database being asserted,\nfor example:\n\n```json\n{\n    \"cypher\": \"CREATE (one:Person {name:'One'})-[:FRIEND_OF]-\u003e(two:Person {name:'Two'})\"\n}\n```\n\nThe second API call is used to verify that the graph in the database is exactly the same as the graph created by the Cypher\nCREATE statement provided in the body of the request. This means that the nodes, their properties and labels, relationships,\nand their properties and labels must be exactly the same. Note that Neo4j internal node/relationship IDs are ignored.\nIn case the graphs aren't identical, the assertion fails and you will get a response with EXPECTATION_FAILED (417) status code.\nIf the test passes, you will get an OK (200).\n\nThe third API call is used to verify that the graph created by provided Cypher statement is a subgraph of the graph in the database.\nRequest body options and response codes are same as above.\n\nFinally, the API call that ensures that the database is empty has the body as an optional requirement and, of course,\nno Cypher is required.\n\n### Cypher procedures and functions\n\nThis module provides a set of Cypher procedures and functions that allows to call the methods from Cypher.\n\n#### Cleaning the database stored procedure from Cypher\n\nThis procedure allows to clear your database. No parameter required. \nExample of usage:\n```\nCALL ga.resttest.clearDatabase();\n``` \n#### Assertion functions from Cypher\n\nThis function allows to assert the state of the database. You need to provide a parameter described shortly. \nExample of usage:\n```\nRETURN ga.resttest.assertSameGraph(\"{ \\\"cypher\\\": \\\"...\\\"}\") AS value;\n```\nThis function is used to verify that the graph in the database is exactly the same as the graph created by the Cypher CREATE statement provided in the parameter. This means that the nodes, their properties and labels, relationships, and their properties and labels must be exactly the same. Note that Neo4j internal node/relationship IDs are ignored.\nIn case the graphs aren't identical, the assertion fails and you will get false value. If the test passes, you will get a true value.\n\nThis function allows to assert a part of the database. You need to provide a parameter described shortly. \nExample of usage:\n```\nRETURN ga.resttest.assertSubgraph(\"{ \\\"cypher\\\": \\\"...\\\"}\") AS value;\n```\nThis function is  is used to verify that the graph created by provided Cypher statement is a subgraph of the graph in the database.\nIn case if the result of cypher is not identical of any subgraph of the database It will return false value. If it is a subgraph of the database you will get a true value.\n\nThis function allows to ensure that the database is empty. You can define a parameter described shortly or use with an empty string. \nExample of usage:\n```\nRETURN ga.resttest.assertEmpty(\"{ \\\"node\\\": \\\"...\\\"}\") AS value;\n```\nIf the database is not empty It will return false value. If it empty you will get a true value.\n\n\n### Request body and user function parameter \n\nIt is possible to use expressions to include/exclude certain nodes, relationships, and properties thereof from the comparisons.\nFor example, for the purposes of comparison, if we only wanted to include nodes labelled `Person`, relationships with type `FRIEND_OF`, and ignore any\n`timestamp` properties on both nodes and relationships, the body of the POST request (or the parameter of the function) would look like this:\n\n```json\n{\n    \"cypher\": \"CREATE (one:Person {name:'One'})-[:FRIEND_OF]-\u003e(two:Person {name:'Two'})\",\n    \"node\":\"hasLabel('Person')\",\n    \"relationship\":\"isType('FRIEND_OF')\",\n    \"node.property\":\"key != 'timestamp'\",\n    \"relationship.property\":\"key != 'timestamp'\"\n}\n```\n\nLicense\n-------\n\nCopyright (c) 2014-2020 GraphAware\n\nGraphAware is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License\nas published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied\nwarranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program.\nIf not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-resttest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphaware%2Fneo4j-resttest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-resttest/lists"}