@@ -108,21 +108,21 @@ public void test04StoreTwoImages() throws Exception {
108108 @ Test
109109 @ Order (5 )
110110 public void test05FailToStoreImageTwice_SamePK () throws Exception {
111- // final Result<Long> storeImage1 = this.screenshotDAOBatis
112- // .storeImage(1L, "test", new ByteArrayInputStream("TEST_STRING".getBytes()));
113- //
114- // if (storeImage1.hasError()) {
115- // storeImage1.getError().printStackTrace();
116- // }
117- // assertFalse(storeImage1.hasError());
118- // final Long newId = storeImage1.get();
119- // assertEquals("1", String.valueOf(newId));
120- //
121- // final Result<Long> storeImage2 = this.screenshotDAOBatis
122- // .storeImage(1L, "test", new ByteArrayInputStream("TEST_STRING123".getBytes()));
123- //
124- // assertTrue(storeImage2.hasError());
125- // assertTrue(storeImage2.getError().getMessage().contains("JdbcSQLIntegrityConstraintViolationException "));
111+ final Result <Long > storeImage1 = this .screenshotDAOBatis
112+ .storeImage (1L , "test" , new ByteArrayInputStream ("TEST_STRING" .getBytes ()));
113+
114+ if (storeImage1 .hasError ()) {
115+ storeImage1 .getError ().printStackTrace ();
116+ }
117+ assertFalse (storeImage1 .hasError ());
118+ final Long newId = storeImage1 .get ();
119+ assertEquals ("1" , String .valueOf (newId ));
120+
121+ final Result <Long > storeImage2 = this .screenshotDAOBatis
122+ .storeImage (1L , "test" , new ByteArrayInputStream ("TEST_STRING123" .getBytes ()));
123+
124+ assertTrue (storeImage2 .hasError ());
125+ assertTrue (storeImage2 .getError ().getMessage ().contains ("SQLIntegrityConstraintViolationException " ));
126126 }
127127
128128}
0 commit comments