// Path: src/main/java/com/maxdemarzi/Schema.java
// @Path("/schema")
// public class Schema {
//         private final DatabaseManagementService dbms;
//         private final GraphDatabaseService db;
//         private static final ObjectMapper objectMapper = new ObjectMapper();
// 
//         public Schema(@Context DatabaseManagementService dbms ) {
//             this.dbms = dbms;
//             this.db = dbms.database( "neo4j" );;
//         }
// 
//         @POST
//         @Path("/create")
//         public Response create() throws IOException {
//             ArrayList<String> results = new ArrayList<>();
// 
//             try (Transaction tx = db.beginTx()) {
//                 org.neo4j.graphdb.schema.Schema schema = tx.schema();
//                 if (!schema.getConstraints(Labels.User).iterator().hasNext()) {
//                     schema.constraintFor(Labels.User)
//                             .assertPropertyIsUnique(USERNAME)
//                             .create();
//                     tx.commit();
//                     results.add("(:User {username}) constraint created");
//                 }
//             }
// 
//             try (Transaction tx = db.beginTx()) {
//                 org.neo4j.graphdb.schema.Schema schema = tx.schema();
//                 if (!schema.getConstraints(Labels.Tag).iterator().hasNext()) {
//                     schema.constraintFor(Labels.Tag)
//                             .assertPropertyIsUnique(NAME)
//                             .create();
//                     tx.commit();
//                     results.add("(:Tag {name}) constraint created");
//                 }
//             }
// 
//             try (Transaction tx = db.beginTx()) {
//                 org.neo4j.graphdb.schema.Schema schema = tx.schema();
//                 if(!schema.getIndexes(Labels.Post).iterator().hasNext()) {
//                     schema.indexFor(Labels.Post)
//                             .on(STATUS)
//                             .create();
//                     tx.commit();
//                     results.add("(:Post {status}) index created");
//                 }
//             }
// 
//             results.add("Schema Created");
//             return Response.ok().entity(objectMapper.writeValueAsString(results)).build();
//         }
// }
// 
// Path: src/main/java/com/maxdemarzi/Properties.java
// public static final String STATUS = "status";
// 
// Path: src/main/java/com/maxdemarzi/Properties.java
// public static final String TIME = "time";


import com.maxdemarzi.Schema;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.neo4j.harness.junit.rule.Neo4jRule;
import org.neo4j.test.server.HTTP;
import java.util.HashMap;
import static com.maxdemarzi.Properties.STATUS;
import static com.maxdemarzi.Properties.TIME;
package com.maxdemarzi.likes;




public class CreateLikesTest {
    @Rule
    public Neo4jRule neo4j = new Neo4jRule()
            .withFixture(FIXTURE)
            .withUnmanagedExtension("/v1", Likes.class)
            .withUnmanagedExtension("/v1", Schema.class);

    @Test
    public void shouldCreateLikes() {
        HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

// Path: src/main/java/com/maxdemarzi/Schema.java
// @Path("/schema")
// public class Schema {
//         private final DatabaseManagementService dbms;
//         private final GraphDatabaseService db;
//         private static final ObjectMapper objectMapper = new ObjectMapper();
// 
//         public Schema(@Context DatabaseManagementService dbms ) {
//             this.dbms = dbms;
//             this.db = dbms.database( "neo4j" );;
//         }
// 
//         @POST
//         @Path("/create")
//         public Response create() throws IOException {
//             ArrayList<String> results = new ArrayList<>();
// 
//             try (Transaction tx = db.beginTx()) {
//                 org.neo4j.graphdb.schema.Schema schema = tx.schema();
//                 if (!schema.getConstraints(Labels.User).iterator().hasNext()) {
//                     schema.constraintFor(Labels.User)
//                             .assertPropertyIsUnique(USERNAME)
//                             .create();
//                     tx.commit();
//                     results.add("(:User {username}) constraint created");
//                 }
//             }
// 
//             try (Transaction tx = db.beginTx()) {
//                 org.neo4j.graphdb.schema.Schema schema = tx.schema();
//                 if (!schema.getConstraints(Labels.Tag).iterator().hasNext()) {
//                     schema.constraintFor(Labels.Tag)
//                             .assertPropertyIsUnique(NAME)
//                             .create();
//                     tx.commit();
//                     results.add("(:Tag {name}) constraint created");
//                 }
//             }
// 
//             try (Transaction tx = db.beginTx()) {
//                 org.neo4j.graphdb.schema.Schema schema = tx.schema();
//                 if(!schema.getIndexes(Labels.Post).iterator().hasNext()) {
//                     schema.indexFor(Labels.Post)
//                             .on(STATUS)
//                             .create();
//                     tx.commit();
//                     results.add("(:Post {status}) index created");
//                 }
//             }
// 
//             results.add("Schema Created");
//             return Response.ok().entity(objectMapper.writeValueAsString(results)).build();
//         }
// }
// 
// Path: src/main/java/com/maxdemarzi/Properties.java
// public static final String STATUS = "status";
// 
// Path: src/main/java/com/maxdemarzi/Properties.java
// public static final String TIME = "time";


// Path: src/test/java/com/maxdemarzi/likes/CreateLikesTest.java
import com.maxdemarzi.Schema;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.neo4j.harness.junit.rule.Neo4jRule;
import org.neo4j.test.server.HTTP;
import java.util.HashMap;
import static com.maxdemarzi.Properties.STATUS;
import static com.maxdemarzi.Properties.TIME;

package com.maxdemarzi.likes;




public class CreateLikesTest {
    @Rule
    public Neo4jRule neo4j = new Neo4jRule()
            .withFixture(FIXTURE)
            .withUnmanagedExtension("/v1", Likes.class)
            .withUnmanagedExtension("/v1", Schema.class);

    @Test
    public void shouldCreateLikes() {
        HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

        HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users/maxdemarzi/likes/jexp/1490140299").toString());