@Test
public void testPKBlobsUpdateByPrimaryKeyWithBLOBs() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
PkblobsMapper mapper = sqlSession.getMapper(PkblobsMapper.class);
PkblobsWithBLOBs record = new PkblobsWithBLOBs(3, generateRandomBlob(), generateRandomBlob(),
"Long String 1");
mapper.insert(record);
record = new PkblobsWithBLOBs(3, generateRandomBlob(), generateRandomBlob(),
"Long String 2");
int rows = mapper.updateByPrimaryKeyWithBLOBs(record);
assertEquals(1, rows);
PkblobsKey key = new PkblobsKey(3);
PkblobsWithBLOBs newRecord = mapper.selectByPrimaryKey(key);
assertNotNull(newRecord);
assertEquals(record.getId(), newRecord.getId());
assertTrue(blobsAreEqual(record.getBlob1(), newRecord.getBlob1()));
assertTrue(blobsAreEqual(record.getBlob2(), newRecord.getBlob2()));