5
5
*/
6
6
package org .hibernate .reactive ;
7
7
8
- import java .util .Objects ;
9
- import java .util .concurrent .CompletionStage ;
10
-
11
- import org .assertj .core .api .Assertions ;
8
+ import io .smallrye .mutiny .Uni ;
9
+ import io .vertx .ext .unit .TestContext ;
10
+ import jakarta .persistence .Entity ;
11
+ import jakarta .persistence .Id ;
12
+ import jakarta .persistence .Table ;
13
+ import jakarta .persistence .Version ;
12
14
import org .hibernate .HibernateException ;
13
15
import org .hibernate .LockMode ;
16
+ import org .hibernate .cfg .AvailableSettings ;
14
17
import org .hibernate .cfg .Configuration ;
15
18
import org .hibernate .reactive .mutiny .Mutiny ;
16
19
import org .hibernate .reactive .provider .Settings ;
17
20
import org .hibernate .reactive .stage .Stage ;
18
21
import org .hibernate .reactive .testing .DatabaseSelectionRule ;
19
-
20
22
import org .junit .Rule ;
21
23
import org .junit .Test ;
22
24
23
- import io .smallrye .mutiny .Uni ;
24
- import io .vertx .ext .unit .TestContext ;
25
- import jakarta .persistence .Entity ;
26
- import jakarta .persistence .Id ;
27
- import jakarta .persistence .Table ;
28
- import jakarta .persistence .Version ;
25
+ import java .util .Objects ;
26
+ import java .util .concurrent .CompletionStage ;
29
27
30
28
import static org .assertj .core .api .Assertions .assertThat ;
31
29
import static org .hibernate .reactive .MyCurrentTenantIdentifierResolver .Tenant .DEFAULT ;
@@ -49,18 +47,19 @@ public class ReactiveMultitenantNoResolverTest extends BaseReactiveTest {
49
47
@ Rule
50
48
public DatabaseSelectionRule selectionRule = DatabaseSelectionRule .runOnlyFor ( POSTGRESQL );
51
49
52
- @ Override
53
- protected Configuration constructConfiguration () {
54
- Configuration configuration = super .constructConfiguration ();
55
- configuration .addAnnotatedClass ( GuineaPig .class );
56
- Assertions .fail ( "ORM-6: TODO: Check how multi-tenancy works in ORM 6" );
57
- // FIXME: Find new syntax for ORM 6
58
- // configuration.setProperty( Settings.MULTI_TENANT, MultiTenancyStrategy.DATABASE.name() );
59
- // Contains the SQL scripts for the creation of the additional databases
60
- configuration .setProperty ( Settings .HBM2DDL_IMPORT_FILES , "/multitenancy-test.sql" );
61
- configuration .setProperty ( Settings .SQL_CLIENT_POOL , TenantDependentPool .class .getName () );
62
- return configuration ;
63
- }
50
+ @ Override
51
+ protected Configuration constructConfiguration () {
52
+ Configuration configuration = super .constructConfiguration ();
53
+ configuration .addAnnotatedClass (GuineaPig .class );
54
+ configuration .setProperty (
55
+ AvailableSettings .MULTI_TENANT_CONNECTION_PROVIDER ,
56
+ "anything"
57
+ );//FIXME this is terrible?
58
+ // Contains the SQL scripts for the creation of the additional databases
59
+ configuration .setProperty (Settings .HBM2DDL_IMPORT_FILES , "/multitenancy-test.sql" );
60
+ configuration .setProperty (Settings .SQL_CLIENT_POOL , TenantDependentPool .class .getName ());
61
+ return configuration ;
62
+ }
64
63
65
64
@ Test
66
65
public void reactivePersistFindDelete (TestContext context ) {
0 commit comments