-
Notifications
You must be signed in to change notification settings - Fork 187
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
GPP4.5
: Functional tests for custom logic functionality
#2494
GPP4.5
: Functional tests for custom logic functionality
#2494
Conversation
a2f4637
to
077f004
Compare
939ce62
to
72fdacd
Compare
077f004
to
8c541da
Compare
cbd715a
to
2c84835
Compare
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.
Good work, with last minor remark
geneticId = virginiaSensitiveData.geneticId | ||
biometricId = virginiaSensitiveData.biometricId | ||
geolocation = virginiaSensitiveData.geolocation | ||
idNumbers = 0 |
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.
Magic number
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.
Updated, but also be aware that I returned:
SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN(UspNatV1Field.SENSITIVE_DATA_PROCESSING + 1),
SENSITIVE_DATA_RELIGIOUS_BELIEFS(UspNatV1Field.SENSITIVE_DATA_PROCESSING + 2),
It's required for normalizing tests
c2777ee
to
75f2209
Compare
75f2209
to
d292aa5
Compare
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.
Generally looks good with some minor remarks. Leaving approve, but please fix those.
|
||
static ModuleConfig getDefaultModuleConfig(List<GppSectionId> sids = [GppSectionId.USP_NAT_V1], | ||
static ModuleConfig getDefaultModuleConfig(ActivityConfig activityConfig = ActivityConfig.configWithDefaultRestrictRules, |
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.
Was there a reason why parameter order doesn't correspond to the field order?
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 field order was changed due to multiple parameter uses. I adjusted the field order of the class.
new LogicalRestrictedRule() | ||
} | ||
|
||
static LogicalRestrictedRule generateSolidRestriction(LogicalOperation logicalOperator, List<ValueRestrictedRule> valueOperations) { |
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 solid
mean in this case?
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 used solid
meaning that we will have a single logic rule with multiple valueRules. The name was changed to generateSingleRestrictedRule
TRANSMIT_PRECISE_GEO("transmitPreciseGeo") | ||
|
||
@JsonValue | ||
String value |
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.
Good habit is to have this kind of fields final
@Override | ||
EqualityValueRule deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JacksonException { | ||
JsonNode node = jsonParser.getCodec().readTree(jsonParser) | ||
def privacySection = UsNationalPrivacySection.valueFromText(node.get(0).get(JSON_LOGIC_VALUE_FIELD).textValue()) |
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 would be good to use null-safe reference in this and related classes.
Example: node?.get(0)?.get(JSON_LOGIC_VALUE_FIELD)?.textValue()
@Override | ||
InequalityValueRule deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JacksonException { | ||
JsonNode node = jsonParser.getCodec().readTree(jsonParser) | ||
def privacySection = UsNationalPrivacySection.valueFromText(node.get(0).get(JSON_LOGIC_VALUE_FIELD).textValue()) |
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.
Same about null-safety as in previous comment.
class LogicalRestrictedRule { | ||
|
||
@JsonProperty("==") | ||
EqualityValueRule equalRule |
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.
Please be consistent with the naming. Looks like this should be called equalityRule
|
||
@ToString(includeNames = true, ignoreNulls = true) | ||
@JsonDeserialize(using = EqualityValueRuleDeserialize.class) | ||
class EqualityValueRule extends ValueRestrictedRule{ |
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.
Syntax
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.
LGTM
No description provided.