Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/include mocks and ext #1

Merged
merged 390 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
390 commits
Select commit Hold shift + click to select a range
5d07aed
Update to TODO
rob-baillie-ortoo Jan 14, 2022
6f868a8
Merge pull request #7 from OrtooApps/feature/filter-and-paging
rob-baillie-ortoo Jan 14, 2022
4ce9495
Added framework changes from the example-app implementation of the fi…
rob-baillie-ortoo Jan 21, 2022
0745ef4
Brought in more changes from the example-app implementation of filter…
rob-baillie-ortoo Jan 24, 2022
3448786
Fixed check on message
rob-baillie-ortoo Jan 24, 2022
f1d6420
Merge pull request #8 from OrtooApps/feature/filter-and-paging-backend
rob-baillie-ortoo Jan 24, 2022
f71596b
Fixed issue with empty result sets resulting in error trying to find …
rob-baillie-ortoo Jan 24, 2022
df408a0
Merge branch 'main' into feature/filter-and-paging
rob-baillie-ortoo Jan 25, 2022
89bffc0
Merge branch 'feature/filter-and-paging-backend' into feature/filter-…
rob-baillie-ortoo Jan 25, 2022
103bfdf
Enhancements to the filter and results
rob-baillie-ortoo Jan 25, 2022
ae97c73
Merge pull request #9 from OrtooApps/feature/filter-and-paging
rob-baillie-ortoo Jan 25, 2022
82c163d
Added options to displayError so it can be adjusted on call
rob-baillie-ortoo Jan 26, 2022
a2c351c
Added options to displayError so it can be adjusted on call
rob-baillie-ortoo Jan 26, 2022
4a2e1d4
Merge pull request #10 from OrtooApps/feature/tweaks-to-error-renderer
rob-baillie-ortoo Jan 26, 2022
7432b57
Added overflow to modal so picklists render properly
rob-baillie-ortoo Jan 26, 2022
7aef99b
Merge branch 'main' into feature/filter-and-paging-backend
rob-baillie-ortoo Jan 31, 2022
9dcd0f6
Started work on a generic LWC that allows an LWC to be included in a …
rob-baillie-ortoo Feb 4, 2022
0625bcb
Added generic LWC to render a highlighted message with similar stylin…
rob-baillie-ortoo Feb 4, 2022
c3e29f5
Added ability to disable the save button in saveButtons
rob-baillie-ortoo Feb 4, 2022
0f90c2e
Initial version of an LWC List View wrapper
rob-baillie-ortoo Feb 4, 2022
19601ba
Upgraded Jest environment
rob-baillie-ortoo Feb 4, 2022
71e5297
Added tests for getEpochTime
rob-baillie-ortoo Feb 7, 2022
b9bc589
Added unit tests for the redirect to tab page controller
rob-baillie-ortoo Feb 7, 2022
658ce8c
Added editor config for formatting the PRs in github
rob-baillie-ortoo Feb 7, 2022
c746627
Formatting tidy
rob-baillie-ortoo Feb 7, 2022
b65a435
Added label for the lwcListViewWrapper 'old link' error
rob-baillie-ortoo Feb 7, 2022
10282b1
Merge pull request #11 from OrtooApps/feature/more-core-lwc-work
rob-baillie-ortoo Feb 7, 2022
7b48b6f
Rename Tab Page Controller
rob-baillie-ortoo Feb 7, 2022
778c28b
Merge pull request #12 from OrtooApps/feature/rename-tab-page-controller
rob-baillie-ortoo Feb 7, 2022
329321c
Rename tabPageName to tabName - removing references to 'page'
rob-baillie-ortoo Feb 7, 2022
cfb8296
Remove package lock and ignore it
rob-baillie-ortoo Feb 7, 2022
7ebdb39
Merge pull request #13 from OrtooApps/feature/remove-package-lock
rob-baillie-ortoo Feb 7, 2022
33b42fa
Merge pull request #14 from OrtooApps/feature/filter-and-paging-backend
rob-baillie-ortoo Feb 7, 2022
bfc8c10
Added ability to reference the fragment / hash on a URI
rob-baillie-ortoo Feb 9, 2022
b88cb53
Added ability to reference the fragment / hash on a URI
rob-baillie-ortoo Feb 10, 2022
dd6c931
Merge pull request #15 from OrtooApps/feature/access-uri-fragments
rob-baillie-ortoo Feb 10, 2022
58a1c78
Added ability to specify criteria for related fields with IN
rob-baillie-ortoo Feb 14, 2022
45e3498
Added 'notInSet' for related fields into criteria
rob-baillie-ortoo Feb 14, 2022
040c5d1
Merge pull request #16 from OrtooApps/feature/improve-criteria
rob-baillie-ortoo Feb 15, 2022
11690fc
Removed chances of NaN being displayed on pagination controls
rob-baillie-ortoo Feb 15, 2022
68306b3
Removed possibility of null offset in search window
rob-baillie-ortoo Feb 15, 2022
b68bd66
Merge pull request #17 from OrtooApps/feature/improve-pagination-control
rob-baillie-ortoo Feb 15, 2022
2cb008c
Started the process of fully wrapping fflib_Criteria
rob-baillie-ortoo Feb 15, 2022
f392e92
Added remaining public methods from fflib_Criteria to ortoo_Criteria
rob-baillie-ortoo Feb 15, 2022
66303ff
Minor improvement to uriUtils test to check console.error output
rob-baillie-ortoo Feb 16, 2022
746fc54
Added a lot of tests for ortoo_Criteria
rob-baillie-ortoo Feb 16, 2022
018946e
Fixed typo
rob-baillie-ortoo Feb 16, 2022
234dc61
Merge pull request #18 from OrtooApps/feature/more-robust-criteria
rob-baillie-ortoo Feb 16, 2022
6907297
Added ability to pass in literals to fflib_Criteria
rob-baillie-ortoo Feb 21, 2022
b858500
Started playing with evaluating things against date literals
rob-baillie-ortoo Feb 21, 2022
d4d8519
More experiments with comparing dates
rob-baillie-ortoo Feb 21, 2022
9323e95
Removed defunct 'evaluator'
rob-baillie-ortoo Feb 22, 2022
e49e2bc
Formatting updated to standards
rob-baillie-ortoo Feb 24, 2022
8849cc8
Added ortoo_Asserts and moved all Amoss_Asserts calls over to ortoo
rob-baillie-ortoo Feb 24, 2022
ac74a5f
Started a date literals test
rob-baillie-ortoo Feb 24, 2022
9c674fb
Added more dateLiteral tests (this and next week)
rob-baillie-ortoo Feb 24, 2022
9850046
More tests on date literals - covering months
rob-baillie-ortoo Feb 24, 2022
c0794ac
Added some edge case tests
rob-baillie-ortoo Feb 24, 2022
796ca56
Started to add tests for the comparables in date literals
rob-baillie-ortoo Feb 24, 2022
432925a
Added tests for DateLiterals for weeks (and tomorrow)
rob-baillie-ortoo Feb 24, 2022
e31bdd7
Added tests for DateLiterals for months and next / last 90 days
rob-baillie-ortoo Feb 24, 2022
8ae7cb9
Added tests for last / next n
rob-baillie-ortoo Feb 24, 2022
49d47c9
Finished the date literal tests and fixed a boundary bug
rob-baillie-ortoo Feb 24, 2022
38da713
Added test and documentation to fflib objects relating to DateLiteral…
rob-baillie-ortoo Feb 28, 2022
fb6a7be
Removed codecoverage from the apex test runs (buggy)
rob-baillie-ortoo Feb 28, 2022
93b8eb2
Merge pull request #19 from OrtooApps/feature/criteria-with-date-lite…
rob-baillie-ortoo Feb 28, 2022
50aab44
Removed ortoo_qra reference
rob-baillie-ortoo Mar 3, 2022
513d3d9
Started experimentation with Org Wide SOQL results cache
rob-baillie-ortoo Mar 3, 2022
bff4b34
Co-authored-by: SundusShahbaz <SundusShahbaz@users.noreply.github.com>
rob-baillie-ortoo Mar 3, 2022
2e30935
Added cache partition
rob-baillie-ortoo Mar 3, 2022
563ae2e
Added a permissions service that allows us to find if a user has a cu…
rob-baillie-ortoo Mar 4, 2022
58624e0
Only allow access to the SOQL cache if the user has a custom permission
rob-baillie-ortoo Mar 4, 2022
a27eb51
Formatting fixes on the Organisation Service
rob-baillie-ortoo Mar 4, 2022
6fcf832
Added simple test for Permissions Service
rob-baillie-ortoo Mar 4, 2022
a188674
Added tests and robustness to the org cache soql executor
rob-baillie-ortoo Mar 7, 2022
a2f3aa6
Added cacheability to the dynamic Sobject Selector
rob-baillie-ortoo Mar 7, 2022
9c5361c
Merge pull request #20 from OrtooApps/feature/cached-soql-executor
rob-baillie-ortoo Mar 7, 2022
58625db
Enhanced the cached soql executor
rob-baillie-ortoo Mar 8, 2022
b447dad
Fixing issues with the use of other cache types
rob-baillie-ortoo Mar 8, 2022
ef541de
Added tests for NONE cache scope
rob-baillie-ortoo Mar 8, 2022
c4190c3
Tidy messages so cache misses are not reported when a NullCache is used
rob-baillie-ortoo Mar 8, 2022
b7ed664
Added PMD suppressions for valid violations
rob-baillie-ortoo Mar 8, 2022
3f1ea97
Merge pull request #21 from OrtooApps/feature/cached-soql-executor
rob-baillie-ortoo Mar 8, 2022
6a6ba9f
Sketching out the idea of the sobject cache
rob-baillie-ortoo Mar 8, 2022
577e8b0
Implemented version with a cache entry per sobject
rob-baillie-ortoo Mar 8, 2022
9b31ce9
Implemented a bulk version - everything in Maps...
rob-baillie-ortoo Mar 8, 2022
9e347aa
Made the SObjectCache more generic. Added docs
rob-baillie-ortoo Mar 9, 2022
72a988f
Moved both types of cache into the same partition (core)
rob-baillie-ortoo Mar 9, 2022
48259c6
Removed redundant code
rob-baillie-ortoo Mar 9, 2022
5d00e7f
Removed need to pass the namespace in to get the qualified keys
rob-baillie-ortoo Mar 9, 2022
3658177
Abstraction of permissions check for access to the platform cache
rob-baillie-ortoo Mar 10, 2022
377619d
Changed permissions service test to test the actual implementation (l…
rob-baillie-ortoo Mar 10, 2022
8a5dfda
Renamed the BulkObjectCache to the correct ObjectCache
rob-baillie-ortoo Mar 10, 2022
c60ecc3
Added removeAll to the OrgCache and fixed test for setting ORG scope
rob-baillie-ortoo Mar 10, 2022
3906e1a
Added a test for NullCache
rob-baillie-ortoo Mar 10, 2022
525aa2c
Added test and robustness to SessionCache
rob-baillie-ortoo Mar 10, 2022
86f84bc
Added tests for the OrgCache
rob-baillie-ortoo Mar 10, 2022
3b80f95
Reformatted tests so they do not include fluent calls to the tested m…
rob-baillie-ortoo Mar 10, 2022
e456765
Reformatted tests to ensure Clayton picks up testing of the methods
rob-baillie-ortoo Mar 10, 2022
c743113
Fixed compile error
rob-baillie-ortoo Mar 10, 2022
776d691
Started to write and sketch the test for ObjectCache
rob-baillie-ortoo Mar 10, 2022
dc44f8d
Started testing get on objectCache
rob-baillie-ortoo Mar 11, 2022
475bf33
Fixed unit test fragility
rob-baillie-ortoo Mar 11, 2022
36dcd3d
Adding more testing, removing some defunct code and clarifying error …
rob-baillie-ortoo Mar 11, 2022
00823a1
Started to test 'remove' methods
rob-baillie-ortoo Mar 14, 2022
7bc1289
Finished ObjectCacheTest
rob-baillie-ortoo Mar 14, 2022
72e1eb9
Simplify ObjectCache to use a cache key per put
rob-baillie-ortoo Mar 14, 2022
6d1013e
Added tests for getKeys
rob-baillie-ortoo Mar 14, 2022
c40e580
Remove chance of blank keys and ids in the cache
rob-baillie-ortoo Mar 14, 2022
678acfd
Added single object puts
rob-baillie-ortoo Mar 14, 2022
aedd0a1
Added exception tests for put
rob-baillie-ortoo Mar 14, 2022
999d1de
Added static messagePrefix to error messages
rob-baillie-ortoo Mar 15, 2022
77c0007
Added ability to configure the SearchOrderByWithout a config
rob-baillie-ortoo Mar 16, 2022
7401666
Added static messagePrefix to error messages
rob-baillie-ortoo Mar 15, 2022
37801e0
Merge branch 'temp/support-qassign-integration' of github.com:OrtooAp…
rob-baillie-ortoo Mar 16, 2022
cec3bf8
Fixed unit tests with literal strings for the prefix on errors
rob-baillie-ortoo Mar 16, 2022
1901e0b
Added tests to SearchOrderBy with no config
rob-baillie-ortoo Mar 16, 2022
c7c7a7c
Moved the default error prefix over to a label
rob-baillie-ortoo Mar 16, 2022
72b4caf
Pointless TODO update for testing
rob-baillie-ortoo Mar 16, 2022
34e2cce
Removed bad update
rob-baillie-ortoo Mar 16, 2022
a99c196
Added getChildren to the DmlRecord
rob-baillie-ortoo Mar 22, 2022
0b6d115
Added docs and clarified name for DmlRecord method to get child sobjects
rob-baillie-ortoo Mar 22, 2022
f1b0c09
Added tests for DmlRecord.getChildSobjects
rob-baillie-ortoo Mar 22, 2022
63c0a18
Added ability to find if a DmlDefiner will delete other records
rob-baillie-ortoo Mar 23, 2022
5fe2224
Added the ability to get the Id of a persisted fabricatedSobject
rob-baillie-ortoo Mar 23, 2022
0d88df9
Added ability to add sub criteria without specifying the logic condition
rob-baillie-ortoo Mar 24, 2022
a1c58d9
Added clearance of the object register when fabricated Sobjects are p…
rob-baillie-ortoo Mar 24, 2022
69a9fea
Merge pull request #23 from OrtooApps/feature/updates-to-support-exam…
rob-baillie-ortoo Mar 24, 2022
2ccc43a
Merge pull request #24 from OrtooApps/main
rob-baillie-ortoo Mar 24, 2022
4e86c73
Added passing through of labels into the buttons in the view and edit…
rob-baillie-ortoo Mar 25, 2022
fc8c930
Merge pull request #25 from OrtooApps/feature/updates-to-support-exam…
rob-baillie-ortoo Mar 25, 2022
1380b62
Added objectHelper - which allows us to generate ids for use in the UI
rob-baillie-ortoo Mar 28, 2022
8c9d06a
Added assertion comment
rob-baillie-ortoo Mar 28, 2022
9fa245e
Added some generic labels
rob-baillie-ortoo Mar 28, 2022
d29484d
Changed generateRowId to generateId, since that's more accurate
rob-baillie-ortoo Mar 28, 2022
dbfd232
Changed generateRowId to generateId, since that's more accurate
rob-baillie-ortoo Mar 28, 2022
2a2e9b1
Added proper ortoo id to the save buttons in the view and edit form
rob-baillie-ortoo Mar 29, 2022
bd555da
Added the ability to get the Id of an Sobject saved via the DmlService
rob-baillie-ortoo Mar 29, 2022
0ad54fd
Added test
rob-baillie-ortoo Mar 29, 2022
0626cd9
Committing whitespace removal
rob-baillie-ortoo Mar 30, 2022
c818af7
Fixed sharing on class
rob-baillie-ortoo Mar 30, 2022
62b2089
Added ability to convert a Set of Strings to a List of Strings
rob-baillie-ortoo Mar 30, 2022
5e008f5
Improved output of inaccessible fields on security violation
rob-baillie-ortoo Mar 30, 2022
868890c
Added the ability to mark only certain fields as dirty when first add…
rob-baillie-ortoo Mar 30, 2022
f034717
Added capability to populate datatable columns with sobject definitio…
rob-baillie-ortoo Mar 31, 2022
69216ef
Added capability to populate datatable columns with sobject definitio…
rob-baillie-ortoo Mar 31, 2022
65e34a1
Added unit test for the new configure labels on datatableHelper
rob-baillie-ortoo Mar 31, 2022
0009267
Added unit test for new errorRenderer capabilitites
rob-baillie-ortoo Mar 31, 2022
68b8323
Merge pull request #26 from OrtooApps/feature/updates-to-support-exam…
rob-baillie-ortoo Mar 31, 2022
de09d1a
Merge branch 'main' into feature/sobject-cache
rob-baillie-ortoo Apr 1, 2022
d1e13aa
Merge pull request #22 from OrtooApps/feature/sobject-cache
rob-baillie-ortoo Apr 1, 2022
278cca8
Implement defaulting of the Service implementation based on naming co…
rob-baillie-ortoo Apr 1, 2022
da86bd7
Added tests for the defaulting of service implementations based on th…
rob-baillie-ortoo Apr 1, 2022
7d7a255
Added tests for the defaulting of service implementations based on th…
rob-baillie-ortoo Apr 1, 2022
51f5c25
Added testing for the internals that determine the default Service name
rob-baillie-ortoo Apr 1, 2022
acdf375
Merge pull request #27 from OrtooApps/feature/defaulting-implementations
rob-baillie-ortoo Apr 1, 2022
81f916b
Starting to build a simple logger
rob-baillie-ortoo Apr 5, 2022
ad9f7bc
Improvements to the logger output
rob-baillie-ortoo Apr 5, 2022
b53423e
Added custom setting that allows for logging levels to be specified
rob-baillie-ortoo Apr 5, 2022
338f1a7
Added clarity of the log level for exceptions - handled in the static…
rob-baillie-ortoo Apr 5, 2022
7c25516
Make the logger service more robust to exceptions
rob-baillie-ortoo Apr 5, 2022
ae77a3e
Improved logging when failing to generate a logger
rob-baillie-ortoo Apr 5, 2022
53caeec
Set the default logging level in the logging service implementation
rob-baillie-ortoo Apr 6, 2022
778cafc
Added testing for the logger implementation
rob-baillie-ortoo Apr 7, 2022
41658f9
Added test for the static method based LoggerService
rob-baillie-ortoo Apr 7, 2022
6238a10
Moved some code over to use the logger service
rob-baillie-ortoo Apr 7, 2022
ab5112f
Added the ability to strip context from ortoo_Exceptions
rob-baillie-ortoo Apr 7, 2022
276ee44
Moved the FakeLogger out to TestLoggerService so other classes can us…
rob-baillie-ortoo Apr 7, 2022
0870a6d
Added TestLoggerUtils to make it easier to switch logging to the righ…
rob-baillie-ortoo Apr 7, 2022
145d9f6
Started to add testing around logging in the CachedSoqlExecutor
rob-baillie-ortoo Apr 7, 2022
30d2f09
Added assertion capabilities to the TestLoggerService
rob-baillie-ortoo Apr 8, 2022
bd86ba2
Move the logger service test over to use the new test utils
rob-baillie-ortoo Apr 8, 2022
875b961
Removed redundant TODO
rob-baillie-ortoo Apr 8, 2022
5ae972a
Moved logger service into core
rob-baillie-ortoo Apr 19, 2022
c7a6997
Added test for ServiceUtils.logAndRethrow
rob-baillie-ortoo Apr 19, 2022
912d43f
Simplified the setup of the test logger instance
rob-baillie-ortoo Apr 19, 2022
3e3cffc
Simplified the setup of the test logger instance
rob-baillie-ortoo Apr 19, 2022
88d1827
Improved comparing of exceptions in tests
rob-baillie-ortoo Apr 19, 2022
04d8b4b
Corrected test execution
rob-baillie-ortoo Apr 19, 2022
56df48d
Merge pull request #28 from OrtooApps/feature/simple-logging-module
rob-baillie-ortoo Apr 19, 2022
bac4ce7
Made tests more robust
rob-baillie-ortoo Apr 20, 2022
f10210a
Lazy load the Unit of Work, so it doesn't get built when it isn't needed
rob-baillie-ortoo Apr 20, 2022
dd53ebb
Attempting to improve startup and logging service performance
rob-baillie-ortoo Apr 20, 2022
d4c4ad3
Fixed test
rob-baillie-ortoo Apr 20, 2022
5bae05d
FIxed bug with performance improvements in the logger service - null …
rob-baillie-ortoo Apr 20, 2022
a82924a
Improved the startup performance when AppLogic, ChildRecordFinder or …
rob-baillie-ortoo Apr 20, 2022
75e4e54
Improved the startup performance when AppLogic, ChildRecordFinder or …
rob-baillie-ortoo Apr 20, 2022
0dcd5ea
Applied string based factory configurations to more factories, to imp…
rob-baillie-ortoo Apr 21, 2022
e303575
Added tests for stripLocalNamespace
rob-baillie-ortoo Apr 21, 2022
20d029e
Fixed issue with selector factory not getting local namespaced SObjec…
rob-baillie-ortoo Apr 21, 2022
9534a6f
Fixed code that got the Selector type for a given Sobject Type
rob-baillie-ortoo Apr 21, 2022
e366958
Added tests for the new getSobjectLocalName
rob-baillie-ortoo Apr 21, 2022
8dd4482
Merge pull request #29 from OrtooApps/feature/improve-applicaiton-per…
rob-baillie-ortoo Apr 21, 2022
20bface
Removed the example services
rob-baillie-ortoo Apr 21, 2022
118f8d6
Added back the permissions service
rob-baillie-ortoo Apr 21, 2022
9b099b5
Added custom metadata for the permissions service, so it cannot be ov…
rob-baillie-ortoo Apr 21, 2022
52c2442
Merge pull request #30 from OrtooApps/feature/remove-example-services
rob-baillie-ortoo Apr 21, 2022
baaf94d
Block duplicate config records
rob-baillie-ortoo Apr 21, 2022
bf2ffc9
Merge pull request #31 from OrtooApps/feature/block-duplicate-configs
rob-baillie-ortoo Apr 21, 2022
ab04fad
Started the sketch of the dynamic SObject UOW
rob-baillie-ortoo Apr 22, 2022
0bf55d4
Added tests for the dynamic unit of work
rob-baillie-ortoo Apr 22, 2022
be4e4c4
Added output of better exception when a circular reference is found i…
rob-baillie-ortoo Apr 22, 2022
fdc89e8
Added direct test for the dynamic unit of work ordering resolution
rob-baillie-ortoo Apr 22, 2022
01ca71e
Merge pull request #32 from OrtooApps/feature/add-dynamic-uow
rob-baillie-ortoo Apr 22, 2022
93d5fff
Added factory methods for the Dynamic Unit of Work
rob-baillie-ortoo Apr 25, 2022
a86e3f8
Added OS licenses as static resource
rob-baillie-ortoo Apr 25, 2022
4f4b7d1
Minor update to credits file - do not imply that the license file lin…
rob-baillie-ortoo Apr 25, 2022
05c0b92
Tidy of TODO file
rob-baillie-ortoo Apr 25, 2022
3dc4fcf
Merge pull request #33 from OrtooApps/feature/add-dynamic-uow
rob-baillie-ortoo Apr 25, 2022
bb0d696
Merge pull request #34 from OrtooApps/feature/add-credits-file
rob-baillie-ortoo Apr 25, 2022
502b1c6
Merge branch 'main' into temp/support-qassign-integration
rob-baillie-ortoo Apr 25, 2022
2685af3
Simplified passing of mapping into SearchOrderBy and added test for t…
rob-baillie-ortoo Apr 25, 2022
a788274
Fixed merge error in test
rob-baillie-ortoo Apr 25, 2022
4938a08
Merge pull request #35 from OrtooApps/temp/support-qassign-integration
rob-baillie-ortoo Apr 25, 2022
e76cf0f
Standardised the build - particularly running apex and getting the co…
rob-baillie-ortoo Apr 25, 2022
4683f0b
Merge pull request #36 from OrtooApps/feature/standardise-build-in-fr…
rob-baillie-ortoo Apr 25, 2022
efc4672
Added removeAll to session cache
rob-baillie-ortoo Apr 25, 2022
a6c4484
Merge pull request #37 from OrtooApps/feature/slight-improvement-to-s…
rob-baillie-ortoo Apr 26, 2022
3a26bd2
Started to build 'max age' on cache retrieval
rob-baillie-ortoo Apr 26, 2022
14fc597
Added tests for OrgCache ageing and improved behaviours
rob-baillie-ortoo Apr 26, 2022
e8d1113
Added ageing capabilities to SessionCache and NullCache
rob-baillie-ortoo Apr 26, 2022
08124af
Improved split between DateLiterals and DateTimeUtils
rob-baillie-ortoo Apr 27, 2022
807239c
Added test and documentation for the cache entry
rob-baillie-ortoo Apr 27, 2022
ba3a74c
Updated TestDateTimeUtils so that now and today are always in step
rob-baillie-ortoo Apr 27, 2022
d122285
Added the ability to specify a maximum age or minimum date added on t…
rob-baillie-ortoo Apr 27, 2022
53edd71
Added test for age based cache retrieval in CachedSoqlExecutor
rob-baillie-ortoo Apr 27, 2022
97870e0
Added ability to specify maxAge and minDate in Dynamic Selector query…
rob-baillie-ortoo Apr 27, 2022
cb8cea0
Added test that re-querying aged results will put them back into the …
rob-baillie-ortoo Apr 27, 2022
cd363c5
Removed redundant TODOs
rob-baillie-ortoo Apr 27, 2022
933fe55
Merge pull request #38 from OrtooApps/feature/timestamped-cache-entries
rob-baillie-ortoo Apr 27, 2022
8c028af
Added some notes... temp commit
rob-baillie-ortoo Apr 28, 2022
d6caada
Merge pull request #39 from OrtooApps/temp/demo
rob-baillie-ortoo Apr 28, 2022
37c6223
Another change
rob-baillie-ortoo Apr 28, 2022
eab9439
Merge pull request #40 from OrtooApps/temp/demo-2
rob-baillie-ortoo Apr 28, 2022
2601d46
Improved hiding of date literal setters
rob-baillie-ortoo Apr 28, 2022
d36342e
Merge pull request #41 from OrtooApps/feature/timestamped-cache-entries
rob-baillie-ortoo Apr 28, 2022
e19d5ea
Added the ability to specify the condition on a queryfactory by using…
rob-baillie-ortoo Apr 28, 2022
1123e65
Avoid conflicting conditions being set
rob-baillie-ortoo Apr 28, 2022
8d63341
Added a VSCode snippets file
rob-baillie-ortoo May 3, 2022
3a8cd5e
Fixed snippets issues
rob-baillie-ortoo May 3, 2022
b42821a
Fixed sharing on service snippets
rob-baillie-ortoo May 3, 2022
2cadfa6
Squashed 'subfolders/fflib/' content from commit 6eb7db0
rob-baillie-ortoo May 4, 2022
ad7ad4b
Merge commit '2cadfa684480e349737d01f051c89ab7a425fda4' as 'subfolder…
rob-baillie-ortoo May 4, 2022
10bb547
removed fflib again
rob-baillie-ortoo May 4, 2022
0598dee
Squashed 'framework/fflib/' content from commit baaf94d
rob-baillie-ortoo May 4, 2022
cc23295
Merge commit '0598deef2560f7365d9c6c4a78b1846d75d6a6f1' as 'framework…
rob-baillie-ortoo May 4, 2022
47d1162
removed fflib again
rob-baillie-ortoo May 4, 2022
e33b28e
Merge commit '07a3aafda9332ed74397bbec9319589bd3e0bec3' as 'subfolder…
rob-baillie-ortoo May 4, 2022
1b3ba7b
Put apex-mocks and apex-extensions into the fflib directory
rob-baillie-ortoo May 4, 2022
1a7964e
Removed external dependencies from the fflib extensions
rob-baillie-ortoo May 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions sfdx-source/apex-common/main/classes/fflib_Application.cls
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,7 @@ public virtual class fflib_Application
}

try {
if ( !serviceInterfaceName.endsWith( 'ILoggerService' ) )
{
LoggerService.log( LoggerService.LEVEL.INFO, 'Using default implementation ' + defaultServiceName + ' for ' + serviceInterfaceName );
}

System.debug( LoggingLevel.INFO, 'Using default implementation ' + defaultServiceName + ' for ' + serviceInterfaceName );
return defaultServiceType.newInstance();
}
catch ( Exception e ) {
Expand Down
4 changes: 2 additions & 2 deletions sfdx-source/apex-common/main/classes/fflib_QueryFactory.cls
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr
}
set;
}
private ISearchCriteria conditionCriteria;
private fflib_ISoqlable conditionCriteria;
private Integer limitCount;
private Integer offsetCount;
private List<Ordering> order;
Expand Down Expand Up @@ -347,7 +347,7 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr
/**
* @param conditionExpression Sets the WHERE clause to the string provided by the given ISearchCriteria
**/
public fflib_QueryFactory setCondition(ISearchCriteria criteria){
public fflib_QueryFactory setCondition(fflib_ISoqlable criteria){
this.conditionCriteria = criteria;
this.conditionExpression = null;
return this;
Expand Down
73 changes: 41 additions & 32 deletions sfdx-source/apex-common/test/classes/fflib_QueryFactoryTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -72,56 +72,61 @@ private class fflib_QueryFactoryTest {
}

@isTest
static void iSearchCriteriaCondition(){
static void iSoqlableCondition(){

String whereClause = 'name = \'test\'';

Amoss_Instance searchCriteriaController = new Amoss_Instance( ISearchCriteria.class );
searchCriteriaController
.when( 'toSoql' )
.returns( whereClause );
fflib_ApexMocks mocks = new fflib_ApexMocks();
fflib_ISoqlable mockSoqlable = (fflib_ISoqlable)mocks.mock( fflib_ISoqlable.class );

mocks.startStubbing();
mocks.when( mockSoqlable.toSOQL() ).thenReturn( whereClause );
mocks.stopStubbing();

fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType);
qf.selectField('name');
qf.setCondition( (ISearchCriteria)searchCriteriaController.getDouble() );
qf.setCondition( mockSoqlable );

System.assertEquals( whereClause, qf.getCondition(), 'setCondition, when given an ISearchCriteria, will set the condition based on the criteria' );
System.assertEquals( whereClause, qf.getCondition(), 'setCondition, when given an fflib_ISoqlable, will set the condition based on the criteria' );

String query = qf.toSOQL();
System.assert( query.endsWith('WHERE name = \'test\''),'Query should have ended with a filter on name, got: '+query);

((fflib_ISoqlable)mocks.verify( mockSoqlable, mocks.atLeast(1))).toSoql();
}

@isTest
static void iSearchCriteriaCondition_notEvaluatedOnSet(){
static void iSoqlableCondition_notEvaluatedOnSet(){

Amoss_Instance searchCriteriaController = new Amoss_Instance( ISearchCriteria.class );
searchCriteriaController
.expectsNoCalls();
fflib_ApexMocks mocks = new fflib_ApexMocks();
fflib_ISoqlable mockSoqlable = (fflib_ISoqlable)mocks.mock( fflib_ISoqlable.class );

fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType);
qf.selectField('name');
qf.setCondition( (ISearchCriteria)searchCriteriaController.getDouble() );
qf.setCondition( mockSoqlable );

searchCriteriaController.verify();
((fflib_ISoqlable)mocks.verify( mockSoqlable, mocks.never())).toSoql();
}

@isTest
static void iSearchCriteriaCondition_isEvaluatedOnGet(){
static void iSoqlableCondition_isEvaluatedOnGet(){

String whereClause = 'name = \'test\'';

Amoss_Instance searchCriteriaController = new Amoss_Instance( ISearchCriteria.class );
searchCriteriaController
.when( 'toSoql' )
.returns( whereClause );
fflib_ApexMocks mocks = new fflib_ApexMocks();
fflib_ISoqlable mockSoqlable = (fflib_ISoqlable)mocks.mock( fflib_ISoqlable.class );

mocks.startStubbing();
mocks.when( mockSoqlable.toSOQL() ).thenReturn( whereClause );
mocks.stopStubbing();

fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType);
qf.selectField('name');
qf.setCondition( (ISearchCriteria)searchCriteriaController.getDouble() );
qf.setCondition( mockSoqlable );

qf.getCondition();

searchCriteriaController.verify();
((fflib_ISoqlable)mocks.verify( mockSoqlable, mocks.times(1))).toSoql();
}

@isTest
Expand All @@ -130,17 +135,19 @@ private class fflib_QueryFactoryTest {
String stringWhereClause = 'name = \'string\'';
String criteriaWhereClause = 'name = \'criteria\'';

Amoss_Instance searchCriteriaController = new Amoss_Instance( ISearchCriteria.class );
searchCriteriaController
.when( 'toSoql' )
.returns( criteriaWhereClause );
fflib_ApexMocks mocks = new fflib_ApexMocks();
fflib_ISoqlable mockSoqlable = (fflib_ISoqlable)mocks.mock( fflib_ISoqlable.class );

mocks.startStubbing();
mocks.when( mockSoqlable.toSOQL() ).thenReturn( criteriaWhereClause );
mocks.stopStubbing();

fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType);
qf.selectField('name');
qf.setCondition( stringWhereClause );
qf.setCondition( (ISearchCriteria)searchCriteriaController.getDouble() );
qf.setCondition( mockSoqlable );

System.assertEquals( criteriaWhereClause, qf.getCondition(), 'setCondition, when given a string then a ISearchCriteria, will set the condition based on the last thing - the criteria' );
System.assertEquals( criteriaWhereClause, qf.getCondition(), 'setCondition, when given a string then a fflib_ISoqlable, will set the condition based on the last thing - the criteria' );
}

@isTest
Expand All @@ -149,17 +156,19 @@ private class fflib_QueryFactoryTest {
String stringWhereClause = 'name = \'string\'';
String criteriaWhereClause = 'name = \'criteria\'';

Amoss_Instance searchCriteriaController = new Amoss_Instance( ISearchCriteria.class );
searchCriteriaController
.when( 'toSoql' )
.returns( criteriaWhereClause );
fflib_ApexMocks mocks = new fflib_ApexMocks();
fflib_ISoqlable mockSoqlable = (fflib_ISoqlable)mocks.mock( fflib_ISoqlable.class );

mocks.startStubbing();
mocks.when( mockSoqlable.toSOQL() ).thenReturn( criteriaWhereClause );
mocks.stopStubbing();

fflib_QueryFactory qf = new fflib_QueryFactory(Contact.SObjectType);
qf.selectField('name');
qf.setCondition( (ISearchCriteria)searchCriteriaController.getDouble() );
qf.setCondition( mockSoqlable );
qf.setCondition( stringWhereClause );

System.assertEquals( stringWhereClause, qf.getCondition(), 'setCondition, when given a ISearchCriteria then string, will set the condition based on the last thing - the string' );
System.assertEquals( stringWhereClause, qf.getCondition(), 'setCondition, when given a fflib_ISoqlable then string, will set the condition based on the last thing - the string' );
}

@isTest
Expand Down
19 changes: 19 additions & 0 deletions sfdx-source/apex-mocks/fflib_Answer.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright (c) 2017 FinancialForce.com, inc. All rights reserved.
*/

/**
* Interface for the answering framework.
* This interface must be implemented inside the test class and implement the call back method answer.
* @group Core
*/
public interface fflib_Answer
{
/**
* Method to be implemented in the test class to implement the call back method.
* @param invocation The invocation on the mock.
* @throws The exception to be thrown.
* @return The value to be returned.
*/
Object answer(fflib_InvocationOnMock invocation);
}
5 changes: 5 additions & 0 deletions sfdx-source/apex-mocks/fflib_Answer.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<status>Active</status>
</ApexClass>
105 changes: 105 additions & 0 deletions sfdx-source/apex-mocks/fflib_AnyOrder.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
Copyright (c) 2017 FinancialForce.com, inc. All rights reserved.
*/

/**
* 'Classic' invocation verifier - checks that a method was called with the given arguments the expected number of times.
* The order of method calls is not important.
* @group Core
*/
public class fflib_AnyOrder extends fflib_MethodVerifier
{
/*
* Verifies a method was invoked the expected number of times, with the expected arguments.
* @param qualifiedMethod The method to be verified.
* @param methodArg The arguments of the method that needs to be verified.
* @param verificationMode The verification mode that holds the setting about how the verification should be performed.
*/
protected override void verify(
fflib_QualifiedMethod qm,
fflib_MethodArgValues expectedArguments,
fflib_VerificationMode verificationMode)
{
List<fflib_IMatcher> expectedMatchers = fflib_Match.Matching ? fflib_Match.getAndClearMatchers(expectedArguments.argValues.size()) : null;
List<fflib_MethodArgValues> actualArguments = fflib_MethodCountRecorder.getMethodArgumentsByTypeName().get(qm);

Integer methodCount = getMethodCount(expectedArguments, expectedMatchers, actualArguments);

String qualifier = '';
Integer expectedCount = null;

if((verificationMode.VerifyMin == verificationMode.VerifyMax) && methodCount != verificationMode.VerifyMin)
{
expectedCount = verificationMode.VerifyMin;
}
else if (verificationMode.VerifyMin != null && verificationMode.VerifyMin > methodCount)
{
expectedCount = verificationMode.VerifyMin;
qualifier = ' or more times';
}
else if (verificationMode.VerifyMax != null && verificationMode.VerifyMax < methodCount)
{
expectedCount = verificationMode.VerifyMax;
qualifier = ' or fewer times';
}

if (expectedCount != null)
{
throwException(qm, '', expectedCount, qualifier, methodCount, verificationMode.CustomAssertMessage, expectedArguments, expectedMatchers, actualArguments);
}
}

private Integer getMethodCount(fflib_MethodArgValues methodArg, List<fflib_IMatcher> matchers, List<fflib_MethodArgValues> methodArgs)
{
Integer retval = 0;

if (methodArgs != null)
{
if (matchers != null)
{
for (fflib_MethodArgValues args : methodArgs)
{
if (fflib_Match.matchesAllArgs(args, matchers))
{
capture(matchers);
retval ++;
}
}
}
else
{
return countCalls(methodArgs, methodArg);
}
}

return retval;
}

private Integer countCalls(List<fflib_MethodArgValues> methodArgs, fflib_MethodArgValues methodArg)
{
Integer count = 0;

for(fflib_MethodArgValues arg: methodArgs)
{
if( arg == methodArg) count++;
}

return count;
}

/*
* Method that validate the verification mode used in the verify.
* Not all the methods from the fflib_VerificationMode are implemented for the different classes that extends the fflib_MethodVerifier.
* The error is thrown at run time, so this method is called in the method that actually performs the verify.
* @param verificationMode The verification mode that have to been verified.
* @throws Exception with message for the fflib_VerificationMode not implemented.
*/
protected override void validateMode(fflib_VerificationMode verificationMode)
{
if(verificationMode.Method == fflib_VerificationMode.ModeName.CALLS)
{
throw new fflib_ApexMocks.ApexMocksException(
'The calls() method is available only in the InOrder Verification.');
}
}
}
5 changes: 5 additions & 0 deletions sfdx-source/apex-mocks/fflib_AnyOrder.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<status>Active</status>
</ApexClass>
Loading