-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: P4ADEV-1636 WF ClassifyIuvActivity: define classification labels #72
base: main
Are you sure you want to change the base?
feat: P4ADEV-1636 WF ClassifyIuvActivity: define classification labels #72
Conversation
…ation-define-labels
Quality Gate passedIssues Measures |
@Lazy | ||
@Slf4j | ||
@Service | ||
public class ClassificationService { |
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.
public class ClassificationService { | |
public class TransferClassificationService { |
.toList(); | ||
|
||
if (labels.isEmpty()) { | ||
throw new ClassificationException("Cannot define classification"); |
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.
instead of throwing an exception, could we apply a default one (eg: UNKNOWN)
@@ -0,0 +1,21 @@ | |||
package it.gov.pagopa.payhub.activities.service.classifications; |
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.
use nested package to group them
package it.gov.pagopa.payhub.activities.service.classifications; | |
package it.gov.pagopa.payhub.activities.service.classifications.trclassifiers; |
* and determine a classification label ({@link ClassificationsEnum}). Each implementation | ||
* should handle a particular condition or set of conditions to decide the appropriate label. | ||
*/ | ||
public interface LabelClassifier { |
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.
public interface LabelClassifier { | |
public interface TransferClassifier { |
public class IufNoTesClassifier implements LabelClassifier { | ||
|
||
@Override | ||
public ClassificationsEnum define(TransferDTO transferDTO, PaymentsReportingDTO paymentsReportingDTO, TreasuryDTO treasuryDTO) { |
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.
can we rename the enum into TransferClassificationEnum
?
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.
This Enum is not only used for Transfers
LabelClassifier classifier = new RtIufTesClassifier(); | ||
|
||
@Test | ||
void whenDefineThenSuccess() { |
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.
void whenDefineThenSuccess() { | |
void givenMatchedConditionWhenDefineThenSuccess() { |
} | ||
|
||
@Test | ||
void whenDefineThenReturnNull() { |
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.
void whenDefineThenReturnNull() { | |
void givenUnmatchedConditionWhenDefineThenReturnNull() { |
} | ||
|
||
@Test | ||
void whenDefineThenReturnNull() { |
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.
you should test also unmatched amounts
void whenDefineThenReturnNull() { | |
void givenUnmatchedConditionWhenDefineThenReturnNull() { |
LabelClassifier classifier = new RtTesClassifier(); | ||
|
||
@Test | ||
void whenDefineThenSuccess() { |
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.
void whenDefineThenSuccess() { | |
void givenMatchedConditionWhenDefineThenSuccess() { |
} | ||
|
||
@Test | ||
void whenDefineThenReturnNull() { |
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.
void whenDefineThenReturnNull() { | |
void givenUnmatchedConditionWhenDefineThenReturnNull() { |
Description
List of Changes
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: