mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
test(codeartifact): pin ResourceNotFoundException on DeleteDomain of a missing domain (#4107)
AWS returns ResourceNotFoundException (404) when DeleteDomain targets a domain that does not exist, even though the API reference leaves it out of the operation's error list. Keep that behaviour, pin it with unit and integration tests, and note it in the docs and next to requireDomain. Closes #4000
This commit is contained in:
1 parent
98ffdc2af4
commit
2e038b5cfb
4 files changed
+26
-2
No files matched your search
+6
@@ -162,6 +162,10 @@ public class CodeArtifactService implements Resettable {
|
||||
return new DomainView(d, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* A missing domain fails with {@code ResourceNotFoundException} (404), which is what AWS
|
||||
* returns even though the API reference leaves it out of DeleteDomain's error list.
|
||||
*/
|
||||
public synchronized DomainView deleteDomain(String region, String domain, String domainOwner) {
|
||||
String owner = effectiveOwner(domainOwner);
|
||||
String key = domainKey(region, domain);
|
||||
@@ -687,6 +691,8 @@ public class CodeArtifactService implements Resettable {
|
||||
}
|
||||
}
|
||||
|
||||
// Used by DeleteDomain too: AWS returns ResourceNotFoundException for a missing domain there,
|
||||
// although the API reference does not declare it on that operation.
|
||||
private CodeArtifactDomain requireDomain(String owner, String key, String domainName) {
|
||||
if (domainName == null || domainName.isBlank()) {
|
||||
throw validation("domain is required.");
|
||||
|
||||
Reference in new issue
Block a user