Skip to main content
15 events
when toggle format what by license comment
Apr 23, 2021 at 14:16 vote accept joacoiudica
Apr 22, 2021 at 8:21 history edited Kalpana CC BY-SA 4.0
added 214 characters in body
Apr 22, 2021 at 8:20 comment added Kalpana If the issue is resolved. Could you please accept the answer.
Apr 21, 2021 at 14:34 comment added joacoiudica that worked. thank you very much!
Apr 21, 2021 at 14:10 comment added Kalpana The issue is that the PushTopic name must be unique. Could you please try to generate the random name and then set that as a name in test class context. Sample code to generate random string. Integer len = 20; Blob blobKey = crypto.generateAesKey(128); String key = EncodingUtil.convertToHex(blobKey); String Name = key.substring(0,len);
Apr 21, 2021 at 14:02 comment added joacoiudica did that. it says that the ':' character is not supported, so I removed that part of the datetime, and after doing that, I added some text depending on what pushtopic it is, and even after doing that, the duplicate value errors still appears.
Apr 21, 2021 at 13:47 comment added Kalpana Max length can be 25 characters only. So you can try one thing just remove "Question_Answered" in case of test class is running. So the Name will be current datetime if Test.isRunningTest() is true.
Apr 21, 2021 at 13:46 review Low quality posts
Apr 22, 2021 at 6:43
Apr 21, 2021 at 13:41 comment added joacoiudica now the upsert fails because the string is too long. this is incredible
Apr 21, 2021 at 13:17 comment added joacoiudica I'll try changing the '_test' for the date as you say. Thanks
Apr 21, 2021 at 13:17 comment added joacoiudica I don't really know what you mean by only for test class, but the chain of events is this. I run the test class and the upsert in that method fails. No other part of the script fails, just that
Apr 21, 2021 at 12:55 comment added Kalpana This issue is for only test class, right? Is it working fine when it comes to actual testing? Instead of _Test, try adding the current date & time in the name. So it won't fail.
Apr 21, 2021 at 12:34 review First posts
Apr 21, 2021 at 13:46
Apr 21, 2021 at 12:32 comment added joacoiudica didn't work, the upsert fail keeps showing up :/
Apr 21, 2021 at 12:28 history answered Kalpana CC BY-SA 4.0