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

Clean up RecordDaoTest #477

Closed
wants to merge 14 commits into from
Closed

Conversation

jladieu
Copy link
Contributor

@jladieu jladieu commented Jan 31, 2024

This is maintenance cleanup/refactoring: AJ-1533, followup from

Clean up RecordDaoTest

  • Get rid of unnecessary new HashMap<>(...) throughout.
  • Prefer RecordAttributes.empty() to new RecordAttributes(Map.of()).
  • Prefer Collections.emptyMap() to Map.of().

Note: Collections.emptyMap() and Map.of() are not equivalent, see: https://stackoverflow.com/questions/46404933/map-of-vs-collections-emptymap

While arguably Map.of() is preferred where possible, I think emptyMap() is more readable and in tests I think readability matters more unless Map.of()'s behavior is explicitly relevant to what's being tested.

jladieu and others added 14 commits January 18, 2024 20:13
* beginning of python test
* serve files from nginx
This encapsulates all the `@Autowired` fields required for`buildPfbQuartzJob`, intended to lower the resistance the tests provide when modifying the `PfbQuartzJob` constructor.
* Add RecordTypeSchema.getAttributeSchema

* Comment argument names

* Formatting
* Add DataTypeMapping.getBaseType

* Add test for DataTypeMapping.getArrayTypeForBase

* Refactor DataTypeMapping.getArrayTypeForBase

* Add names for parameterized tests

* Refactor configuration of base types and array types
* Add alternate constructors for AttributeSchema

* Fix order of expected/actual values

* Remove public modifiers

* Add another test
Add prepareThreshold=0 to default JDBC configuration
* first pass one download
---------
Co-authored-by: Josh Ladieu <[email protected]>
Spring Boot 3.2.2 / Spring Framework 6.1.3
* Add basic attribute data type conversions

* Move test cases to separate class

* Add explanations to some assertions

* Use equals instead of ==

* Refactor supported data types

* Refactor check for number <=> boolean conversions

* Pass message to test helpers

* Move test argument providers to RecordOrchestratorServiceTest

* Handle additional error codes

* Add comment

* Remove support for array to scalar conversions
)

* Add support for converting date and datetime attributes

* Refactor conditions with enums

* Mark SQL functions immutable

* Move SQL functions to sys_wds schema

* Handle datetime overflows when converting from numbers

* Reject conversions between boolean and date/datetime
* Add tests for SQL expressions for data type conversions

* Attempt to get as many of the args statements onto one line

---------

Co-authored-by: Josh Ladieu <[email protected]>
@jladieu jladieu closed this Jan 31, 2024
@jladieu
Copy link
Contributor Author

jladieu commented Jan 31, 2024

I goofed up base branch on this.

Replaced by #478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants