Allon Mureinik has uploaded a new change for review.

Change subject: core: Simplify ImagesHandlerTest assertions
......................................................................

core: Simplify ImagesHandlerTest assertions

Simplified ImagesHandlerTest's assertion to use JUnit's best practices.

Change-Id: I4e731278049b91586a6876372f0c44122b7e3c5a
Signed-off-by: Allon Mureinik <[email protected]>
---
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImagesHandlerTest.java
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/55/36755/1

diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImagesHandlerTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImagesHandlerTest.java
index 1261a38..310f646 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImagesHandlerTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImagesHandlerTest.java
@@ -102,7 +102,7 @@
 
         List<DiskImage> intersection = ImagesHandler.imagesSubtract(list1, 
list2);
 
-        assertEquals("Intersection should contain only one disk", 
intersection.size(), 1);
+        assertEquals("Intersection should contain only one disk", 1, 
intersection.size());
         assertTrue("Intersection should contains disk1", 
intersection.contains(disk1));
     }
 
@@ -124,21 +124,21 @@
     public void testJsonDiskDescription() throws IOException {
         String jsonDescription = null;
         jsonDescription = ImagesHandler.getJsonDiskDescription("DiskAlias", 
"DiskDescription");
-        assertTrue("Should be map of disk alias and disk description",
-                
jsonDescription.equals("{\"DiskAlias\":\"DiskAlias\",\"DiskDescription\":\"DiskDescription\"}"));
+        assertEquals("Should be map of disk alias and disk description",
+                
"{\"DiskAlias\":\"DiskAlias\",\"DiskDescription\":\"DiskDescription\"}", 
jsonDescription);
     }
 
     @Test
     public void testJsonNullDiskDescription() throws IOException {
         String jsonDescription = 
ImagesHandler.getJsonDiskDescription("DiskAlias", null);
-        assertTrue("Should be map of disk alias and disk description",
-                
jsonDescription.equals("{\"DiskAlias\":\"DiskAlias\",\"DiskDescription\":\"\"}"));
+        assertEquals("Should be map of disk alias and disk description",
+                "{\"DiskAlias\":\"DiskAlias\",\"DiskDescription\":\"\"}", 
jsonDescription);
     }
 
     @Test
     public void testJsonEmptyDiskDescription() throws IOException {
         String jsonDescription = 
ImagesHandler.getJsonDiskDescription("DiskAlias", "");
-        assertTrue("Should be map of disk alias and disk description",
-                
jsonDescription.equals("{\"DiskAlias\":\"DiskAlias\",\"DiskDescription\":\"\"}"));
+        assertEquals("Should be map of disk alias and disk description",
+                "{\"DiskAlias\":\"DiskAlias\",\"DiskDescription\":\"\"}", 
jsonDescription);
     }
 }


-- 
To view, visit http://gerrit.ovirt.org/36755
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e731278049b91586a6876372f0c44122b7e3c5a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to