java - Assert Response Payload of Zip File -
in application, i'm combining many files single zip file via java.util.zip.zipoutputstream
api, want know how write effective unit test of zip file.
at first began "test.zip" in test/resources , compared generated expected comparing bytes, doesn't work. bytes retrieved httpservletresponse
(in case of test mockhttpservletresponse
)
how can test zip contains proper file signatures?
i suggest compare content. after getting zip file, unpack , compare have same amount of files, have same names , files's contents same.
Comments
Post a Comment