TransWikia.com

UnitTest: Cannot take whole Blob value from return value for System.assertequals

Salesforce Asked by rosa on January 8, 2021

I have a class that I want to do unit_test, which returns Blob value above 3000byte.
Regarding this, I want to compare it with expected value, using toString method.

However, I can’t get the whole value… always come in short of some letters or byte at the end.
It does not matter whether I am getting the value of string or blob.

How can I get whole value?

Unit test( is working but not getting the full value of test )

Blob test = response.responseBody;
System.assertEquals(expectedBlob.toString(), test.toString()); 
System.assertEquals('last12letters',test.toString().substringAfter('justbeforeThe12letters = ').substring(0,10));

expectedBlob.toString

??;;.abchowareyoutoday_givemewholevalue_justbeforeThe12letters_last12letters

test.toString

??;;.abchowareyoutoday_givemewholevalue_justbeforeThe12letters_las12l

Like this returned version of Blob has some letters in luck.
This is almost all some letters at the last and
some wrongly cut around the end as well.

Thank you.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP