// Path: src/main/java/org/homer/versioner/core/procedure/Init.java
// public class Init extends CoreProcedure {
// 
//     @Procedure(value = "graph.versioner.init", mode = Mode.WRITE)
//     @Description("graph.versioner.init(entityLabel, {key:value,...}, {key:value,...}, additionalLabel, date) - Create an Entity node with an optional initial State.")
//     public Stream<NodeOutput> init(
//             @Name("entityLabel") String entityLabel,
//             @Name(value = "entityProps", defaultValue = "{}") Map<String, Object> entityProps,
//             @Name(value = "stateProps", defaultValue = "{}") Map<String, Object> stateProps,
//             @Name(value = "additionalLabel", defaultValue = "") String additionalLabel,
//             @Name(value = "date", defaultValue = "null") LocalDateTime date) {
// 
//         Node entity = createNode(entityProps, singletonList(entityLabel), transaction);
// 
//         Node state = createNode(stateProps, getStateLabels(additionalLabel), transaction);
// 
//         connectWithCurrentRelationship(entity, state, date);
// 
//         log.info(LOGGER_TAG + "Created a new Entity with label {} and id {}", entityLabel, entity.getId());
// 
//         createRNodeAndAssociateTo(entity, transaction);
// 
//         return streamOfNodes(entity);
//     }
// 
//     private Node createNode(Map<String, Object> properties, List<String> labels, Transaction transaction)  {
// 
//         return setProperties(transaction.createNode(asLabels(labels)), properties);
//     }
// 
//     private void connectWithCurrentRelationship(Node entity, Node state, LocalDateTime date) {
// 
//         LocalDateTime instantDate = (date == null) ? convertEpochToLocalDateTime(Calendar.getInstance().getTimeInMillis()) : date;
//         addCurrentState(state, entity, instantDate);
//     }
// 
//     private void createRNodeAndAssociateTo(Node entity, Transaction transaction) {
// 
//         Node rNode = transaction.createNode(Label.label("R"));
//         rNode.createRelationshipTo(entity, RelationshipType.withName("FOR"));
//     }
// }


import org.homer.versioner.core.procedure.Init;
import org.junit.Test;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.logging.Log;
import java.util.Optional;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.mock;
package org.homer.versioner.core.builders;




/**
 * DiffBuilderTest class, it contains all the method used to test procedure builders
 */
public class InitBuilderTest {
    @Test
    public void shouldBuildCorrectProcedureInstance() {
        Transaction transaction = mock(Transaction.class);
        Log log = mock(Log.class);

// Path: src/main/java/org/homer/versioner/core/procedure/Init.java
// public class Init extends CoreProcedure {
// 
//     @Procedure(value = "graph.versioner.init", mode = Mode.WRITE)
//     @Description("graph.versioner.init(entityLabel, {key:value,...}, {key:value,...}, additionalLabel, date) - Create an Entity node with an optional initial State.")
//     public Stream<NodeOutput> init(
//             @Name("entityLabel") String entityLabel,
//             @Name(value = "entityProps", defaultValue = "{}") Map<String, Object> entityProps,
//             @Name(value = "stateProps", defaultValue = "{}") Map<String, Object> stateProps,
//             @Name(value = "additionalLabel", defaultValue = "") String additionalLabel,
//             @Name(value = "date", defaultValue = "null") LocalDateTime date) {
// 
//         Node entity = createNode(entityProps, singletonList(entityLabel), transaction);
// 
//         Node state = createNode(stateProps, getStateLabels(additionalLabel), transaction);
// 
//         connectWithCurrentRelationship(entity, state, date);
// 
//         log.info(LOGGER_TAG + "Created a new Entity with label {} and id {}", entityLabel, entity.getId());
// 
//         createRNodeAndAssociateTo(entity, transaction);
// 
//         return streamOfNodes(entity);
//     }
// 
//     private Node createNode(Map<String, Object> properties, List<String> labels, Transaction transaction)  {
// 
//         return setProperties(transaction.createNode(asLabels(labels)), properties);
//     }
// 
//     private void connectWithCurrentRelationship(Node entity, Node state, LocalDateTime date) {
// 
//         LocalDateTime instantDate = (date == null) ? convertEpochToLocalDateTime(Calendar.getInstance().getTimeInMillis()) : date;
//         addCurrentState(state, entity, instantDate);
//     }
// 
//     private void createRNodeAndAssociateTo(Node entity, Transaction transaction) {
// 
//         Node rNode = transaction.createNode(Label.label("R"));
//         rNode.createRelationshipTo(entity, RelationshipType.withName("FOR"));
//     }
// }


// Path: src/test/java/org/homer/versioner/core/builders/InitBuilderTest.java
import org.homer.versioner.core.procedure.Init;
import org.junit.Test;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.logging.Log;
import java.util.Optional;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.mock;

package org.homer.versioner.core.builders;




/**
 * DiffBuilderTest class, it contains all the method used to test procedure builders
 */
public class InitBuilderTest {
    @Test
    public void shouldBuildCorrectProcedureInstance() {
        Transaction transaction = mock(Transaction.class);
        Log log = mock(Log.class);

        Optional<Init> result = new InitBuilder().withTransaction(transaction).withLog(log).build();