Search in sources :

Example 6 with DumpCreator

use of org.neo4j.pushtocloud.PushToCloudCommand.DumpCreator in project neo4j by neo4j.

the class PushToCloudCommandTest method shouldAcceptDatabaseNameAsSource.

@Test
public void shouldAcceptDatabaseNameAsSource() throws Exception {
    // given
    Copier targetCommunicator = mockedTargetCommunicator();
    DumpCreator dumpCreator = mockedDumpCreator();
    PushToCloudCommand command = command().copier(targetCommunicator).dumpCreator(dumpCreator).build();
    // when
    String databaseName = DBNAME;
    String[] args = { "--database", databaseName, "--bolt-uri", SOME_EXAMPLE_BOLT_URI };
    new CommandLine(command).execute(args);
    // then
    verify(dumpCreator).dumpDatabase(eq(databaseName), any());
    verify(targetCommunicator).checkSize(anyBoolean(), any(), anyLong(), any());
    verify(targetCommunicator).copy(anyBoolean(), any(), any(), any(), eq(true), any());
}
Also used : CommandLine(picocli.CommandLine) DumpCreator(org.neo4j.pushtocloud.PushToCloudCommand.DumpCreator) Copier(org.neo4j.pushtocloud.PushToCloudCommand.Copier) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.jupiter.api.Test)

Aggregations

DumpCreator (org.neo4j.pushtocloud.PushToCloudCommand.DumpCreator)6 Test (org.junit.jupiter.api.Test)5 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)5 Copier (org.neo4j.pushtocloud.PushToCloudCommand.Copier)5 CommandLine (picocli.CommandLine)5 Path (java.nio.file.Path)2 InOrder (org.mockito.InOrder)1