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

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -