improve StaffImageApiTest (for FINERACT-965 non-regression)
This commit is contained in:
committed by
Yemdjih Kaze Nasser
parent
83de217b64
commit
956a84114f
+3
@@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.integrationtests;
|
package org.apache.fineract.integrationtests;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import io.restassured.builder.RequestSpecBuilder;
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
@@ -58,6 +59,7 @@ public class StaffImageApiTest {
|
|||||||
assertNotNull("Image id should not be null", imageId);
|
assertNotNull("Image id should not be null", imageId);
|
||||||
String imageAsText = ImageHelper.getStaffImageAsText(this.requestSpec, this.responseSpec, staffId);
|
String imageAsText = ImageHelper.getStaffImageAsText(this.requestSpec, this.responseSpec, staffId);
|
||||||
assertNotNull("Image id should not be null", imageAsText);
|
assertNotNull("Image id should not be null", imageAsText);
|
||||||
|
assertEquals(ImageHelper.generateImageAsText(), imageAsText);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -67,6 +69,7 @@ public class StaffImageApiTest {
|
|||||||
assertNotNull("Image id should not be null", imageId);
|
assertNotNull("Image id should not be null", imageId);
|
||||||
byte[] imageAsBytes = ImageHelper.getStaffImageAsBinary(this.requestSpec, this.responseSpec, staffId);
|
byte[] imageAsBytes = ImageHelper.getStaffImageAsBinary(this.requestSpec, this.responseSpec, staffId);
|
||||||
assertNotNull("Image content should not be null", imageAsBytes);
|
assertNotNull("Image content should not be null", imageAsBytes);
|
||||||
|
assertEquals(251, imageAsBytes.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+5
-5
@@ -65,10 +65,10 @@ public class ImageHelper {
|
|||||||
return Utils.performServerDelete(requestSpec, responseSpec, URL, "resourceId");
|
return Utils.performServerDelete(requestSpec, responseSpec, URL, "resourceId");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String generateImageAsText() {
|
public static String generateImageAsText() {
|
||||||
return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ\n"
|
return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ\r\n"
|
||||||
+ "bWFnZVJlYWR5ccllPAAAAJ1JREFUeNpi+P//PwMIA4E9EG8E4idQDGLbw+WhiiqA+D8OXAFVAzbp\n"
|
+ "bWFnZVJlYWR5ccllPAAAAJ1JREFUeNpi+P//PwMIA4E9EG8E4idQDGLbw+WhiiqA+D8OXAFVAzbp\r\n"
|
||||||
+ "DxBvB2JLIGaGYkuoGEjOhhFIHAbij0BdPgxYACMj42ogJQpifwBiXSDeC8JIbt4LxSC5DyxQjTeB\n"
|
+ "DxBvB2JLIGaGYkuoGEjOhhFIHAbij0BdPgxYACMj42ogJQpifwBiXSDeC8JIbt4LxSC5DyxQjTeB\r\n"
|
||||||
+ "+BeaYb+Q5EBOAVutCzMJHUNNPADzzDokiYdAfAmJvwLkGeTgWQfyKZICS6hYBTwc0QL8ORSjBDhA\n" + "gAEAOg13B6R/SAgAAAAASUVORK5CYII=";
|
+ "+BeaYb+Q5EBOAVutCzMJHUNNPADzzDokiYdAfAmJvwLkGeTgWQfyKZICS6hYBTwc0QL8ORSjBDhA\r\n" + "gAEAOg13B6R/SAgAAAAASUVORK5CYII=";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user