Skip to content

Commit 0e31b72

Browse files
committed
[#2666] Test insert with StatelessSession and emebedded id
1 parent 004c675 commit 0e31b72

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/EmbeddedIdTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ public void populateDb(VertxTestContext context) {
4242
test( context, getMutinySessionFactory().withTransaction( s -> s.persistAll( pizza, schnitzel ) ) );
4343
}
4444

45+
@Test
46+
public void testStatelessInsert(VertxTestContext context) {
47+
LocationId nottingham = new LocationId( "UK", "Nottingham" );
48+
Delivery mushyPeas = new Delivery( nottingham, "Mushy Peas with mint sauce" );
49+
test( context, getMutinySessionFactory()
50+
.withStatelessTransaction( s -> s.insert( mushyPeas ) )
51+
.chain( () -> getMutinySessionFactory()
52+
.withTransaction( s -> s.find( Delivery.class, nottingham ) )
53+
)
54+
.invoke( result -> assertThat( result ).isEqualTo( mushyPeas ) )
55+
);
56+
}
57+
4558
@Test
4659
public void testFindSingleId(VertxTestContext context) {
4760
test( context, getMutinySessionFactory().withTransaction( s -> s.find( Delivery.class, verbania ) )

0 commit comments

Comments
 (0)