Skip to content

Commit 86efe37

Browse files
committed
generate
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
1 parent c9e7133 commit 86efe37

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

jnosql-mongodb/src/test/java/org/eclipse/jnosql/databases/mongodb/integration/TemplateIntegrationTest.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,33 @@ void shouldInsertEntityWithMap() {
182182
});
183183
}
184184

185+
@Test
186+
void shouldInsertEntityWithTwoMap() {
187+
var program = Program.of(
188+
"Renamer",
189+
Map.of("twitter", "x")
190+
);
191+
192+
var program2 = Program.of(
193+
"Apple",
194+
Map.of("instagram", "x")
195+
);
196+
var computer = Computer.of("Computer",Map.of("Renamer", program,
197+
"Apple", program2));
198+
199+
var result = this.template.insert(computer);
200+
201+
SoftAssertions.assertSoftly(soft ->{
202+
soft.assertThat(result).isNotNull();
203+
soft.assertThat(result.getName()).isEqualTo("Computer");
204+
soft.assertThat(result.getPrograms()).hasSize(1);
205+
soft.assertThat(result.getPrograms().get("Renamer")).isNotNull();
206+
soft.assertThat(result.getPrograms().get("Renamer").getName()).isEqualTo("Renamer");
207+
soft.assertThat(result.getPrograms().get("Renamer").getSocialMedia()).hasSize(1);
208+
soft.assertThat(result.getPrograms().get("Renamer").getSocialMedia().get("twitter")).isEqualTo("x");
209+
});
210+
}
211+
185212
@Test
186213
void shouldInsertEntityWithMapUsingRecord() {
187214
var program = new ProgramRecord(

0 commit comments

Comments
 (0)