-
Notifications
You must be signed in to change notification settings - Fork 2
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
DMP-4115: Create POST /audio/metadata endpoint #2227
Conversation
"spring.servlet.multipart.max-request-size=4MB", | ||
}) | ||
@SuppressWarnings({"PMD.DoNotUseThreads", "PMD.AvoidInstantiatingObjectsInLoops", "PMD.AvoidThrowingRawExceptionTypes"}) | ||
class AudioControllerAddAudioMetaDataNoSessionITest extends IntegrationBase { |
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.
Minor thing, but think the general pattern is to put IntTest
at the end of the test name instead of ITest
. Could it be changed to make consistent with everything else?
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
String checksum = dataManagementApi.getChecksum(DatastoreContainerType.INBOUND, guid); | ||
if (!checksum.equals(addAudioMetadataRequest.getChecksum())) { | ||
throw new DartsApiException(AudioApiError.FAILED_TO_ADD_AUDIO_META_DATA, | ||
String.format("Checksum in DETs (%s) does not match the one passed in the API request (%s).", |
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 are we talking about DETS here? It's nothing to do with DETS is it?
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 was left over from the first iteration I have updated the message :)
|
||
if (!exists) { | ||
throw new DartsApiException(CommonApiError.NOT_FOUND, | ||
String.format("Blob %s does not exist in container %s was not found.", blobId, containerName)); |
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.
Does this sentence make sense?
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 :)
|
||
if (checksumByte == null) { | ||
throw new DartsApiException(CommonApiError.NOT_FOUND, | ||
String.format("Blob %s does not exist in container %s does not contain a checksum.", blobId, containerName)); |
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.
Does this sentence make sense?
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 :)
} | ||
|
||
@Test | ||
void negativeGetChecksumChecksumNotFound() { |
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.
Checksum in test name twice
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 is by design getChecksum is the method name checksumNotFound is the what we are testing
c21cbfd
to
e84cbd0
Compare
Links
Change description
Create a new endpoint in the darts-api, as defined in the LLD:-
[https://tools.hmcts.net/confluence/pages/viewpage.action?pageId=1682839618#AudioAPILLD-POST/audios/metadata]
This will allow the darts-proxy or darts-gateway to upload audio files directly to storage and so skip an extra transfer.
This should replicate the addAudio call in AudioController but skip uploading of the file.
To test this, an audio file needs to be renamed into a guid before being uploaded into the inbound blob storage. Then, hit the new /audios/metadata endpoint, referencing this audio file. The inbound to unstructured automated task will then need to run before the audio will be able to be previewed in the DARTS portal.
h4. Acceptance Criteria
GIVEN
an audio file exists in the inbound blob storage
WHEN
a request is made to /audios/metadata endpoint for this audio
THEN
check the audio file appears in DARTS portal with the relevant metadata displayed
Does this PR introduce a breaking change? (check one with "x")