-
Notifications
You must be signed in to change notification settings - Fork 2
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
DMP-4674: Log courthouse not found error on addAudio for Dyntrace #2517
base: master
Are you sure you want to change the base?
Conversation
public class AudioLoggerServiceImpl implements AudioLoggerService { | ||
|
||
private final Clock clock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was agreed we wouldn't introduce clock as it creates inconsistent coding standards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding was we needed a follow up call as I took an action to confirm some things. I have updated the logic so the clock stuff is simpler.
We already have inconsistencies as some places use clock some use currentTimeHelper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are only 2 production classes using clock. The rest all use the CurrentTimeHelper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both instances where they have been introduced have been within the last 2 weeks. Can we try and use one pattern until a decision is actually made to use one over the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the logic to use currentTimeHelper
@@ -44,7 +45,7 @@ public static void tearDown() { | |||
|
|||
@BeforeEach | |||
void setUp() { | |||
audioLoggerService = new AudioLoggerServiceImpl(); | |||
audioLoggerService = new AudioLoggerServiceImpl(Clock.fixed(STARTED_AT.toInstant(), STARTED_AT.toZonedDateTime().getZone())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment about use of clock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ticket mentions changing the message in the EventLoggerServiceImpl which doesn't look like has been done as part of this, please can you add?
@@ -14,12 +15,14 @@ | |||
@RequiredArgsConstructor | |||
public class CurrentTimeHelper { | |||
|
|||
private final Clock clock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this change actually give us and why is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It grants us much greater flexibility in adjusting dates/times without needing to utilise mocks in integration tests. (and ensures we are following industry standards for date/time operations)
Links
Change description
Summary of Git Diff
This Git diff introduces enhancements to the
AddAudioMetaDataValidator
and related classes in a Java application. The primary change is the addition of error handling and logging for cases where a specified courthouse does not exist. The updates also include modifications to theAudioLoggerService
to support this new logging functionality and the creation of corresponding unit tests to verify the behavior.Highlights
Error Handling:
validate
method of theAddAudioMetaDataValidator
class to catchDartsApiException
when retrieving the courthouse.AudioLoggerService
.New Logging Method:
missingCourthouse
, has been added to theAudioLoggerService
interface and its implementation to log warnings when a courthouse is not found.Unit Tests:
AddAudioMetaDataValidatorTest
is introduced to validate the behavior of theAddAudioMetaDataValidator
.Code Structure:
AudioLoggerServiceImpl
is modified to include aClock
for timestamping log entries.These changes improve the robustness of the audio metadata validation process by ensuring that invalid input is logged appropriately, aiding both debugging and system monitoring.
Does this PR introduce a breaking change? (check one with "x")