Skip to content

Commit

Permalink
Clean up naming for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
uladzislau-dziuba committed Aug 12, 2024
1 parent 486cdb6 commit 2539a94
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [0.20.20]
### Changed
- Added service-id property to node metadata
- Added service_id property to filter metadata

## [0.20.19]
### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ class MetadataNodeGroupTest {
@Test
fun `should set serviceId to group if present`() {
// given
val expectedServiceId = 777
val nodeGroup = MetadataNodeGroup(createSnapshotProperties(outgoingPermissions = true))
val node = nodeV3(serviceId = 777)
val node = nodeV3(serviceId = expectedServiceId)

// when
val group = nodeGroup.hash(node)

// then
assertThat(group.serviceId).isEqualTo(777)
assertThat(group.serviceId).isEqualTo(expectedServiceId)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal class LuaFilterFactoryTest {
val properties = SnapshotProperties().also { it.incomingPermissions = IncomingPermissionsProperties() }

@Test
fun `should create metadata with service name and discovery service name and service-id`() {
fun `should create metadata with service name and discovery service name`() {
// given
val expectedServiceName = "service-1"
val expectedDiscoveryServiceName = "consul-service-1"
Expand Down Expand Up @@ -46,15 +46,14 @@ internal class LuaFilterFactoryTest {
}

@Test
fun `should create metadata with serviceId`() {
fun `should create filter metadata with serviceId`() {
// given
val expectedServiceId = 777

val group: Group = ServicesGroup(communicationMode = CommunicationMode.XDS, serviceId = expectedServiceId)
val factory = LuaFilterFactory(properties)
val group = ServicesGroup(communicationMode = CommunicationMode.XDS, serviceId = expectedServiceId)
val luaFilterFactory = LuaFilterFactory(properties)

// when
val metadata = factory.ingressScriptsMetadata(group, currentZone = "dc1")
val metadata = luaFilterFactory.ingressScriptsMetadata(group, currentZone = "dc1")

val actualServiceId = metadata
.getFilterMetadataOrThrow("envoy.filters.http.lua")
Expand All @@ -66,13 +65,13 @@ internal class LuaFilterFactoryTest {
}

@Test
fun `should create metadata with empty serviceId`() {
fun `should create filter metadata with empty serviceId`() {
// given
val group: Group = ServicesGroup(communicationMode = CommunicationMode.XDS)
val factory = LuaFilterFactory(properties)
val group = ServicesGroup(communicationMode = CommunicationMode.XDS)
val luaFilterFactory = LuaFilterFactory(properties)

// when
val metadata = factory.ingressScriptsMetadata(group, currentZone = "dc1")
val metadata = luaFilterFactory.ingressScriptsMetadata(group, currentZone = "dc1")

val actualServiceId = metadata
.getFilterMetadataOrThrow("envoy.filters.http.lua")
Expand Down

0 comments on commit 2539a94

Please sign in to comment.