Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd committed Jan 25, 2024
1 parent bcc1119 commit a11fe0d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fun fileToService(
.result
.get()
val services: List<ServiceShape> = model.shapes(ServiceShape::class.java).sorted().toList()
val service = services.singleOrNull() ?: error("Expected one service per aws model, but found ${services.size} in ${file.absolutePath}: ${services.map { it.id }}")
val service = services.singleOrNull() ?: error("Expected one service per aws model, but found ${services.size} in ${file.absolutePath}: ${services.joinToString { it.id.toString() }}")
val protocolName = service.protocolName()

val serviceTrait = service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fun String.kotlinNamespace(): String = split(".")
.joinToString(separator = ".") { segment -> segment.filter { it.isLetterOrDigit() } }

/**
* Convert an sdkID to the module/artifact name to use
* Convert an sdkId to the module/artifact name to use
*/
internal fun sdkIdToArtifactName(sdkId: String): String = sdkId.replace(" ", "").replace("-", "").lowercase()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ class MembershipTest {
assertTrue(Membership().isMember("i3"))
}

@Test
fun testExcludePrecedence() {
val unit = Membership(setOf("m1"), setOf("m1"))
assertFalse(unit.isMember("m1"))
}

@Test
fun testParse() {
val expected = Membership(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class NamingTest {

@Test
fun testSdkIdToArtifactName() {
assertEquals("foobar", sdkIdToArtifactName("foo bar"))
assertEquals("foobar", sdkIdToArtifactName("foo-bar"))
assertEquals("foobar", sdkIdToArtifactName("fOo -Bar"))
}

@Test
Expand Down

0 comments on commit a11fe0d

Please sign in to comment.