ArnIndex implements KnowledgeIndex { public String getServiceArnNamespace(ToShapeId serviceId) { return arnServices.containsKey(serviceId.toShapeId()) ? arnServices.get(serviceId.toShapeId()) : serviceId.toShapeId().getName().toLowerCase(Locale.US); } ArnIndex(Model model); static ArnIndex of(Model model); String getServiceArnNamespace(ToShapeId serviceId); Map<ShapeId, ArnTrait> getServiceResourceArns(ToShapeId service); Optional<ArnTrait> getEffectiveOperationArn(ToShapeId service, ToShapeId operation); Optional<String> getFullResourceArnTemplate(ToShapeId service, ToShapeId resource);  }
@Test public void returnsDefaultServiceArnNamespace() { ArnIndex arnIndex = new ArnIndex(model); assertThat(arnIndex.getServiceArnNamespace(ShapeId.from("ns.foo#NonAwsService")), equalTo("nonawsservice")); }
@Test public void returnsDefaultServiceArnNamespaceForAwsService() { ArnIndex arnIndex = new ArnIndex(model); assertThat(arnIndex.getServiceArnNamespace(ShapeId.from("ns.foo#EmptyAwsService")), equalTo("emptyawsservice")); }