You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/06/04 12:01:22 UTC

[GitHub] [ignite] smoldachev commented on a change in pull request #7886: IGNITE-13104 Fixed incorrect logic in spring-data repositories for findAllById() and deleteAllById() methods. Code cleanup.

smoldachev commented on a change in pull request #7886:
URL: https://github.com/apache/ignite/pull/7886#discussion_r435199127



##########
File path: modules/spring-data-2.2/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java
##########
@@ -332,22 +305,55 @@ public void testUpdateQueryMixedCase() {
     }
 
     /**
-     * Update with a wrong @Query
+     * Update with a wrong @Query.
      */
     @Test
     public void testWrongUpdateQuery() {
-        final String newSecondName = "updatedUniqueSecondName";
-        int rowsUpdated = 0;
-        try {
-            rowsUpdated = repo.setWrongFixedSecondName(newSecondName, "uniquePerson");
-        }
-        catch (Exception e) {
-            //expected
-        }
+        expected.expect(CacheException.class);
+        int rowsUpdated = repo.setWrongFixedSecondName("updatedUniqueSecondName", "uniquePerson");
 
         assertEquals(0, rowsUpdated);
 
         List<Person> person = repo.findByFirstName("uniquePerson");
         assertEquals(person.get(0).getSecondName(), "uniqueLastName");
     }
+
+    /** */
+    private List<PersonKey> fillData() {

Review comment:
       Move to bottom of the class.

##########
File path: modules/spring-data/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java
##########
@@ -226,12 +209,49 @@ public void testDeleteAll() {
         assertEquals(0, repo.count());
     }
 
-    /**
-     *
-     */
+    /** */
     private void fillInRepository() {
         for (int i = 0; i < CACHE_SIZE; i++)
             repo.save(i, new Person("person" + Integer.toHexString(i),
                 "lastName" + Integer.toHexString((i + 16) % 256)));
     }
+
+    /** */
+    private List<PersonKey> fillData() {

Review comment:
       Move to bottom of the class

##########
File path: modules/spring-data-2.0/src/test/java/org/apache/ignite/springdata/IgniteSpringDataCrudSelfTest.java
##########
@@ -332,22 +305,55 @@ public void testUpdateQueryMixedCase() {
     }
 
     /**
-     * Update with a wrong @Query
+     * Update with a wrong @Query.
      */
     @Test
     public void testWrongUpdateQuery() {
-        final String newSecondName = "updatedUniqueSecondName";
-        int rowsUpdated = 0;
-        try {
-            rowsUpdated = repo.setWrongFixedSecondName(newSecondName, "uniquePerson");
-        }
-        catch (Exception e) {
-            //expected
-        }
+        expected.expect(CacheException.class);
+        int rowsUpdated = repo.setWrongFixedSecondName("updatedUniqueSecondName", "uniquePerson");
 
         assertEquals(0, rowsUpdated);
 
         List<Person> person = repo.findByFirstName("uniquePerson");
         assertEquals(person.get(0).getSecondName(), "uniqueLastName");
     }
+
+    /** */
+    private List<PersonKey> fillData() {

Review comment:
       Let's moe to bottom of the class




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org