elvyssoares

LoggingTest - Refactored

May 19th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. File outputFile = null
  2.  
  3. @Before
  4. public void setup() throws IOException{
  5.     outputFile = File.createTempFile("prefix", "png", new File("/tmp"));
  6. }
  7.  
  8. @Test
  9. public void saveImage_noImageFile_ko(){
  10.     ProductImage image = new ProductImage("01010101010101",
  11.                                           ProductImageField.FRONT,
  12.                                           outputFile);
  13.     Response response = serviceWrite.saveImage(image.getCode(),
  14.                                                image.getField(),
  15.                                                image.getImguploadFront(),
  16.                                                image.getImguploadIngredients(),
  17.                                                image.getImguploadNutrition())
  18.                                                .execute();
  19.     assertTrue(response.isSuccess());
  20.     assertThatJson(response.body())
  21.         .node("status")
  22.         .isEqualTo("status not ok");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment