-
Notifications
You must be signed in to change notification settings - Fork 46
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
SWATCH-2302: Capture AWS message transmission statuses in micrometer #3957
base: main
Are you sure you want to change the base?
Conversation
b4d79aa
to
f0dfa61
Compare
...ducer-aws/src/main/java/com/redhat/swatch/aws/service/AwsBillableUsageAggregateConsumer.java
Outdated
Show resolved
Hide resolved
@@ -20,8 +20,7 @@ | |||
*/ | |||
package com.redhat.swatch.aws.service; | |||
|
|||
import static org.junit.jupiter.api.Assertions.assertEquals; | |||
import static org.junit.jupiter.api.Assertions.assertThrows; | |||
import static org.junit.jupiter.api.Assertions.*; |
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.
Probably this was automatically done by intellij, please, avoid diamond imports.
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.
Fixed. But I think we do use wildcards a lot in tests for static imports for JUnit, Mockito, and Hamcrest. I don't think there's an official policy on this enforced by any tooling so it would be good to reach a team consensus on this.
% rg 'import static.*\*' -l | wc -l
83
So 83 classes with wildcards and nearly all of them are in test
it looks like. There are a handful in swatch-core and the main package. We should probably either fix these or at least set the style linter to catch them.
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 style guide is unambiguous about forbidding wildcard imports. So, now we just need to figure out why it's not enforcing that or if we want to as a team make an exception for org.junit
, org.mockito
stuff
f0dfa61
to
992ff4a
Compare
992ff4a
to
7ecfdc9
Compare
Jira issue: SWATCH-2302
Description
When usage is processed by swatch-producer-aws, it increments a counter named
"swatch_producer_metered_total" with the amount in metric units, labeled with
Testing
Unit tests are in the PR.
Setup
Steps
platform.rhsm-subscriptions.billable-usage-hourly-aggregate
. I do it with IntelliJ, but use whatever tool you like.Verification