-
Notifications
You must be signed in to change notification settings - Fork 1
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
Pivotal ID # 188131969: Archieve submission request #868
Conversation
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. Please consider my comments before merging
) { | ||
client | ||
.post() | ||
.uri("$SUBMISSION_REQUEST_URL/$accNo/$version/archieve") |
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.
Typo: archive (the same typo is present in the ticket name)
@@ -1,6 +1,6 @@ | |||
package ebi.ac.uk.db | |||
|
|||
const val MONGO_VERSION = "mongo:4.0.10" | |||
const val MONGO_VERSION = "mongo:4.4.22" |
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.
👍
@@ -127,6 +127,11 @@ interface SubmissionRequestPersistenceService { | |||
accNo: String, | |||
version: Int, | |||
): Boolean | |||
|
|||
suspend fun archieveRequest( |
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.
typo: archive
val created = result.matchedCount < 1 | ||
return submissionRequestRepository.getByAccNoAndStatusIn(request.accNo, PROCESSING) to created | ||
} | ||
|
||
suspend fun archieveRequest( |
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.
typo: archive
@@ -49,6 +49,22 @@ class SubmissionRequestMongoPersistenceService( | |||
return request.map { it.accNo to it.version } | |||
} | |||
|
|||
override suspend fun archieveRequest( |
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.
typo: archive
) { | ||
@AfterEach | ||
fun afterEach() = | ||
runBlocking { | ||
testInstance.deleteAll() | ||
} | ||
|
||
@Test | ||
fun archieveRequest() = |
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.
typo: archive
|
||
val archievedFiles = | ||
archieveRequestFiles() | ||
.every(REPORT_RATE) { "$accNo, $version archieved file ${it.index}, path='${it.value.path}'" } |
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.
typo: archive
filesRepository.save(rqtF2) | ||
testInstance.saveRequest(request) | ||
|
||
val result = testInstance.archieveRequest("abc-123", 2) |
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 test should also include validations for the request no longer being present in the requests collection
) { | ||
require( | ||
requestRepository.existsByAccNoAndVersionAndStatus(accNo, version, PROCESSED), | ||
) { "Request $accNo, $version can not be archieved as not processed" } |
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.
suggestion: "Request $accNo, $version can't be archived since it's not processed"
accNo: String, | ||
version: Int, | ||
) { | ||
requestPersistenceService.archieveRequest(accNo, version) |
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.
typo: archive
https://www.pivotaltracker.com/story/show/188131969