Search in sources :

Example 21 with TransactionStateMachineSPI

use of org.neo4j.bolt.runtime.statemachine.TransactionStateMachineSPI in project neo4j by neo4j.

the class TransactionStateMachineSPIProviderV4Test method shouldReturnDefaultTransactionStateMachineSPIWithEmptyDatabasename.

@Test
void shouldReturnDefaultTransactionStateMachineSPIWithEmptyDatabasename() throws Throwable {
    String databaseName = "neo4j";
    DatabaseManagementService managementService = managementService(databaseName);
    TransactionStateMachineSPIProvider spiProvider = newSpiProvider(managementService);
    when(mockBoltChannel.defaultDatabase()).thenReturn("neo4j");
    TransactionStateMachineSPI spi = spiProvider.getTransactionStateMachineSPI("", mock(StatementProcessorReleaseManager.class, RETURNS_MOCKS));
    assertThat(spi).isInstanceOf(TransactionStateMachineV4SPI.class);
}
Also used : StatementProcessorReleaseManager(org.neo4j.bolt.runtime.statemachine.StatementProcessorReleaseManager) TransactionStateMachineSPI(org.neo4j.bolt.runtime.statemachine.TransactionStateMachineSPI) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService) TransactionStateMachineSPIProvider(org.neo4j.bolt.runtime.statemachine.TransactionStateMachineSPIProvider) Test(org.junit.jupiter.api.Test)

Aggregations

TransactionStateMachineSPI (org.neo4j.bolt.runtime.statemachine.TransactionStateMachineSPI)21 Test (org.junit.jupiter.api.Test)18 BoltTransaction (org.neo4j.bolt.dbapi.BoltTransaction)13 BoltResultHandle (org.neo4j.bolt.runtime.BoltResultHandle)4 StatementProcessorReleaseManager (org.neo4j.bolt.runtime.statemachine.StatementProcessorReleaseManager)3 TransactionStateMachineSPIProvider (org.neo4j.bolt.runtime.statemachine.TransactionStateMachineSPIProvider)3 DatabaseManagementService (org.neo4j.dbms.api.DatabaseManagementService)3 StatementOutcome (org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine.StatementOutcome)2 InOrder (org.mockito.InOrder)1 BoltQueryExecutor (org.neo4j.bolt.dbapi.BoltQueryExecutor)1 BoltConnectionAuthFatality (org.neo4j.bolt.runtime.BoltConnectionAuthFatality)1 BoltStateMachine (org.neo4j.bolt.runtime.statemachine.BoltStateMachine)1 AuthorizationExpiredException (org.neo4j.graphdb.security.AuthorizationExpiredException)1 LoginContext (org.neo4j.internal.kernel.api.security.LoginContext)1