-
Notifications
You must be signed in to change notification settings - Fork 7
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
PP-11205 Add endpoint to expunge and archive historical data #2233
Conversation
- Added endpoint to expunge and archive historical data
ea23ace
to
36c7dfe
Compare
} | ||
|
||
@Test | ||
void shouldArchiveHistoricalServicesAndDetachUsers() throws JsonProcessingException { |
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.
Couple of questions here.
- Does detaching a user mean the user will still be in the
users
table? If so the test should assert that user still exists. - If a user hasn't logged in for more than
EXPUNGE_USER_DATA_AFTER_DAYS
days but is still attached to a live service, does the user get detached/deleted?
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.
yeah, the user will still be in the users
table. I have added an assertion for this.
- Users are detached (irrespective of when they are logged in) when the service is archived
- Only users not associated with any service are deleted after not logged in for more than
EXPUNGE_USER_DATA_AFTER_DAYS
@@ -16,6 +18,7 @@ public class LedgerTransaction { | |||
private String reference; | |||
|
|||
@JsonDeserialize(using = ApiResponseDateTimeDeserializer.class) | |||
@JsonSerialize(using = ApiResponseDateTimeSerializer.class) |
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's the reason for this line?
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.
@@ -121,4 +127,13 @@ private void restoreDropwizardsLogging() { | |||
app.getApplication().getName()); | |||
} | |||
|
|||
private ConfigOverride[] overrideUrlsConfig(ConfigOverride[] configOverrides) { | |||
List<ConfigOverride> newConfigOverride = newArrayList(configOverrides); | |||
newConfigOverride.add(config("ledgerBaseURL", "http://localhost:" + wireMockPort)); |
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.
Why can't this line be added to the newConfigOverrides directly?
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 add it directly. Started with overriding other URLs too but later kept only the ledger URL. Updated!
.withHeader(CONTENT_TYPE, APPLICATION_JSON) | ||
.withStatus(200) | ||
.withBody(objectMapper.writeValueAsString(ledgerResponse)); | ||
wireMockExtension.stubFor( |
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.
Is the wireMockExtension.stubFor
used here instead of wireMockServer.stubFor
because wireMockServer
doesn't work with Junit 5 tests?
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.
Yeah using Extension because of Junit5. We are using @Rule
elsewhere for wireMockServer which doesn't work with Junit5.
WHAT YOU DID