generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Dmp 5271 add api validation get transcriptions document #3093
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
Open
karen-hedges
wants to merge
31
commits into
master
Choose a base branch
from
DMP-5271-AddApiValidationGetTranscriptionsDocument
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+305
−65
Open
Changes from 6 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
4bd4122
DMP-5271 [API Validation] GET/transcriptions/{transcription_id}/docum…
karen-hedges 9cc0fcc
DMP-5271 [API Validation] GET/transcriptions/{transcription_id}/docum…
karen-hedges 4a90844
DMP-5271 [API Validation] GET/transcriptions/{transcription_id}/docum…
karen-hedges b83dd2f
DMP-5271 [API Validation] GET/transcriptions/{transcription_id}/docum…
karen-hedges f748967
Add open api validation test
stephenokeefe 91f7e50
Merge remote-tracking branch 'origin/DMP-5271-AddApiValidationGetTran…
stephenokeefe 7e0ad0c
Integration tests and Open API validation
stephenokeefe 67e897d
Merge branch 'master' into DMP-5271-AddApiValidationGetTranscriptions…
stephenokeefe 71529c7
Refactor
stephenokeefe 72bbe10
Merge remote-tracking branch 'origin/DMP-5271-AddApiValidationGetTran…
stephenokeefe 287d18b
Merge branch 'master' into DMP-5271-AddApiValidationGetTranscriptions…
stephenokeefe b6f1b48
Add test coverage
stephenokeefe 4267773
Merge remote-tracking branch 'origin/DMP-5271-AddApiValidationGetTran…
stephenokeefe e22961f
Add test coverage
stephenokeefe 361ee2b
Add not found tests
stephenokeefe 78a187f
Merge branch 'master' into DMP-5271-AddApiValidationGetTranscriptions…
stephenokeefe fbbde1a
Remove whitespace
stephenokeefe 3cdf6b3
Merge remote-tracking branch 'origin/DMP-5271-AddApiValidationGetTran…
stephenokeefe 778f0e3
DMP-5271 [API Validation] GET/transcriptions/{transcription_id}/docum…
karen-hedges c3679ae
DMP-5271 [API Validation] GET/transcriptions/{transcription_id}/docum…
karen-hedges c580d52
DMP-5271 [API Validation] GET/transcriptions/{transcription_id}/docum…
karen-hedges 99b9bd7
Add open api validation test
stephenokeefe 8c5e490
DMP-5271 [API Validation] GET/transcriptions/{transcription_id}/docum…
karen-hedges cd0eefd
Integration tests and Open API validation
stephenokeefe c4fcf8f
Refactor
stephenokeefe f8a3e78
Add test coverage
stephenokeefe b2bd3ab
Add test coverage
stephenokeefe e7d0e7b
Add not found tests
stephenokeefe 8c408b7
Remove whitespace
stephenokeefe 966451f
Merge remote-tracking branch 'origin/DMP-5271-AddApiValidationGetTran…
stephenokeefe 5a697f7
Adjust tests from master to account for new validation
stephenokeefe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...tionTest/java/uk/gov/hmcts/darts/transcriptions/api/TranscriptionOpenApiContractTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package uk.gov.hmcts.darts.transcriptions.api; | ||
|
|
||
| import com.atlassian.oai.validator.OpenApiInteractionValidator; | ||
| import com.atlassian.oai.validator.model.Request; | ||
| import com.atlassian.oai.validator.model.SimpleRequest; | ||
| import com.atlassian.oai.validator.report.ValidationReport; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
|
||
| @Slf4j | ||
| class TranscriptionOpenApiContractTest { | ||
|
|
||
| private static final OpenApiInteractionValidator VALIDATOR = | ||
| OpenApiInteractionValidator.createForSpecificationUrl( | ||
| TranscriptionOpenApiContractTest.class | ||
| .getResource("/openapi/transcriptions.yaml") | ||
| .toExternalForm() | ||
| ).build(); | ||
|
|
||
| @Test | ||
| void negativeTranscriptionId() { | ||
| Request request = SimpleRequest.Builder | ||
| .get("/transcriptions/-1/document") | ||
| .build(); | ||
|
|
||
| ValidationReport report = VALIDATOR.validateRequest(request); | ||
|
|
||
| assertTrue(report.hasErrors()); | ||
| report.getMessages().forEach(m -> log.info(m.getMessage())); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 you add to the method name the name of the method for controllers get transcription document which I think is attachTranscript
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 test will not reach the controller but I have updated the naming to be clearer