mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
refactor: read and check ARNs through AwsArnUtils in Bedrock, AgentCore and SageMaker (#6970)
The arn-probe and arn-split sites in these services now go through looksLikeArn, isArn, parse and regionOrDefault. The four AgentCore services share BedrockAgentCoreArns.resource, which reads an ARN's resource without its qualifier. A well-formed ARN reads the same as before. tools/partition/baseline.tsv drops from 44 to 34. Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
1 parent
98a3d2a346
commit
5bf89a5061
9 files changed
+85
-35
No files matched your search
+28
@@ -0,0 +1,28 @@
|
||||
package io.github.hectorvent.floci.services.bedrockagentcorecontrol;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
class BedrockAgentCoreArnsTest {
|
||||
|
||||
@Test
|
||||
void resourceDropsTheQualifier() {
|
||||
assertEquals("agent/abc",
|
||||
BedrockAgentCoreArns.resource("arn:aws:bedrock-agentcore:us-east-1:123456789012:agent/abc:7"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void resourceWithoutAQualifierIsKeptWhole() {
|
||||
assertEquals("memory/m-1",
|
||||
BedrockAgentCoreArns.resource("arn:aws-us-gov:bedrock-agentcore:us-gov-west-1:123456789012:memory/m-1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void resourceIsNullForAnythingThatIsNotAnArn() {
|
||||
assertNull(BedrockAgentCoreArns.resource(null));
|
||||
assertNull(BedrockAgentCoreArns.resource("agent/abc"));
|
||||
assertNull(BedrockAgentCoreArns.resource("arn:aws:bedrock-agentcore:us-east-1"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user