Skip to content

Commit 397a4b1

Browse files
author
Nadim Ritter
committed
SEBSP-171 fix broken test
1 parent ad8cd90 commit 397a4b1

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/test/java/ch/ethz/seb/sps/integrationtests/datalayer/batis/dao/ScreenshotDAOBatisTest.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)