DbUnit and binary data

后端 未结 1 353
别跟我提以往
别跟我提以往 2020-12-29 06:55

I use DbUnit for unit-testing of my DAO objects. It works great so far.

I have a problem, I have field ob type byte[] which is stored as BLOB in the da

1条回答
  •  生来不讨喜
    2020-12-29 07:04

    After all I solved it like that:

    XML dataset file:

    
    
        
        
    
    

    DbUnit has built-in support for Base64 encoded data, it transformes correctly into byte array.

    Test case code:

    assertEquals("12345".getBytes(), image.getContent());
    

    0 讨论(0)
提交回复
热议问题