From 53ea3c63f06dc804aa23fecce28b52e85ed61bbc Mon Sep 17 00:00:00 2001 From: sameira Date: Wed, 9 Dec 2015 17:15:15 +0530 Subject: [PATCH] Updated data insertion using an array list --- .../repository/CassandraTemplateIntegrationTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-data-cassandra/src/test/java/org/baeldung/spring/data/cassandra/repository/CassandraTemplateIntegrationTest.java b/spring-data-cassandra/src/test/java/org/baeldung/spring/data/cassandra/repository/CassandraTemplateIntegrationTest.java index fae24e8f21..3108658c0e 100644 --- a/spring-data-cassandra/src/test/java/org/baeldung/spring/data/cassandra/repository/CassandraTemplateIntegrationTest.java +++ b/spring-data-cassandra/src/test/java/org/baeldung/spring/data/cassandra/repository/CassandraTemplateIntegrationTest.java @@ -23,6 +23,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -79,8 +80,10 @@ public class CassandraTemplateIntegrationTest { public void whenSavingBooks_thenAllAvailableOnRetrieval() { Book javaBook = new Book(UUIDs.timeBased(), "Head First Java", "O'Reilly Media", ImmutableSet.of("Computer", "Software")); Book dPatternBook = new Book(UUIDs.timeBased(), "Head Design Patterns", "O'Reilly Media", ImmutableSet.of("Computer", "Software")); - cassandraTemplate.insert(javaBook); - cassandraTemplate.insert(dPatternBook); + List bookList = new ArrayList<>(); + bookList.add(javaBook); + bookList.add(dPatternBook); + cassandraTemplate.insert(bookList); Select select = QueryBuilder.select().from("book").limit(10); List retrievedBooks = cassandraTemplate.select(select, Book.class);