Comments (4)
@derroman ah, interesting find! My apologies for not catching this, the repo has a slightly different version of Query than I use in prod but thatβs my fault for not checking the quote wrapping for Ids. Your fix is a good one - I will incorporate it shortly!
from apex-dml-mocking.
@derroman this is now resolved. This was an interesting opportunity to delve into toString()
's base implementation - apparently, calling toString()
on a Set adds spaces between the different entries; it's possible that the List class does this as well, but there it is obfuscated by an oddity singular to Set - it is an Iterable (you can use it in a for
loop, after all), but it does not publicly show that. Most objects you can call instanceof
to detect what they are, which is how the string parsing in the Query
class works. However, from my previous work on this (as part of the Nebula Framework), I knew that Sets do not test true for being an Iterable, which is why they are handled separately to begin with.
Long story short - I shot myself in the foot by having a test involving Sets with multiple Ids ... but the Ids that I was using had the same value. I was able to easily reproduce your issue in the existing test that I have purely by updating the test to include a second unique Id. That was a tragic oversight on my part; it was fine to use the same Id for testing that Lists worked with this newer implementation, but of course the same value being added to a Set just reduces it to a single value.
Thanks for bringing this to my attention, and for using this framework!
from apex-dml-mocking.
But just for fun and because I did not find the time yet (a.k.a "too lazy to debug" ;-) ):
Why does this happen in the first place?
from apex-dml-mocking.
@jamessimone great and thanks for the interesting explanation!
from apex-dml-mocking.
Related Issues (12)
- System.NullPointerException in AccountHandlerTests HOT 3
- Add support for FLS-checked queries HOT 1
- Add support for parent-level filtering with Query object
- Salesforce String gets shortened HOT 3
- Add readme of how to create all your classes to SFDC HOT 3
- Feature request: Support DMLOptions and AccessLevel for writes HOT 2
- Add License File HOT 1
- DMLMock Issue HOT 3
- isEmpty check in doDelete and doHardDelete methods HOT 2
- Add support for aggregate queries
- I have an issue in AccountHandlerTests HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apex-dml-mocking.