Commit Graph

7 Commits

Author SHA1 Message Date
Ilkka Seppälä 8389456532 refactor: sanitize javadoc 2024-05-23 18:40:52 +03:00
k1w1dev ef42e169b9 fix: Fix sonar issues (#2925)
* Remove unused member which was also causing a false positive sonar issue.
Fixes sonar issue https://sonarcloud.io/project/issues?open=AY3gHwu5DIZTZkppqVEG&id=iluwatar_java-design-patterns

* Fixes sonar issue https://sonarcloud.io/project/issues?open=AXK0OzDA-CiGJS70dLki&id=iluwatar_java-design-patterns
related to "Refactor the code of the lambda to not have multiple invocations throwing the same checked exception."

Also, updated the code to use Instant and Duration to deal with time instead of int. Added the awaitility
library to perform assertions in test which is more reliable than using Thread.sleep directly to wait for events to happen.

* checkstyle fix

* Add sneaky throws to fix sonar lint issue. This is fine as the newFile method is not being tested but instead the new SimpleFileWriter(...) is.

* The first booking needs to happen outside the assertions. Fixed other warnings

* Use records to pass around related objects instead of using a large number of
individual params, which sonar did not like.

* Checkstyle fixes

* checkstyle fixes

* Remove complexity to keep sonar happy.

* Split into different methods to reduce complexity. Could be broken down even further but currently Sonar is happy.

* Move files to correct package

* Add valid assertions to tests

* rename constants to avoid confusion

* Sonar warning related to cognitive complexity can be suppressed as the methods are quite generic and not functional enough to be separated out.

* Use constants to keep Sonar happy

* Use correct constant naming conventions

* Use correct constant naming conventions

* Use lombok to define noargsconstructor

* Use a single method to do the logging

* Remove unused constructor and redundant method

* Use a reusable method for logging
2024-05-04 08:20:01 +03:00
Ilkka Seppälä 20e804ba95 docs: improvements to the Context Object docs 2024-04-06 10:14:46 +03:00
Rahul Raj fb7ec9b375 dependencies: #2449 bump maven-checkstyle-plugin from 3.1.0 to 3.2.0 + resolve chec… (#2464)
* #2449 bump maven-checkstyle-plugin from 3.1.0 to 3.2.0 + resolve checkstyle issues

* remove FileSelectorJFrame.java to resolve checkstyle issue

* remove FileSelectorJFrame.java to resolve checkstyle issue

* remove FileSelectorJFrame.java to resolve checkstyle issue

* add refactored file with correct filename to resolve checkstyle issue

* add the test data

* change filenames from JFrame to Jframe for checkstyle

* fix code smell from  sonar report

* add new testcases to improve the test coverage

* remove code smell
2023-02-04 19:20:54 +02:00
Ilkka Seppälä c4e40f2be1 fix: Fix context object tests (#2416)
* add missing sonar goal

* fix ServiceContextTest

* update test

* refactor test
2023-01-01 14:52:51 +02:00
Ilkka Seppälä 8877ba70d3 fix: Fix context object (#2415)
* fix pr builder goals

* update links

* add context-object to build

* add autogenerated content

* fix checkstyle findings
2023-01-01 12:28:51 +02:00
Chak-C e223459db8 feature: Add context object pattern (#2304)
* Add context object pattern and corresponding tests

* Update context pattern

* Add README, class diagram, puml file.
Add toString method in ServiceContext.java.
Add tests for coverage.

* Improvements:
Remove plugin in pom file
Add comments in app.java
Change local variable keyword to var in app.java
Use lombok for getters, setters and tostring
Change method signature in context object

* Refreshing environment-1

* Reconfigure pom file.

Co-authored-by: Alvis Chan <u7287079@edu.anu.au>
Co-authored-by: u7287079 <u7287079@anu.edu.au>
2022-12-29 11:17:28 +02:00