consumers/current adding consumer name etc

This commit is contained in:
simonredfern 2025-12-27 22:57:28 +01:00
parent eccd54bb40
commit b0182792e3
3 changed files with 13 additions and 1 deletions

View File

@ -567,6 +567,9 @@ trait APIMethods600 {
|""",
EmptyBody,
CurrentConsumerJsonV600(
app_name = "SOFI",
app_type = "Web",
description = "Account Management",
consumer_id = "123",
call_counters = redisCallCountersJsonV600
),
@ -597,7 +600,7 @@ trait APIMethods600 {
currentConsumerCallCounters <- Future(RateLimitingUtil.consumerRateLimitState(consumer.consumerId.get).toList)
callCountersJson = createRedisCallCountersJson(currentConsumerCallCounters)
} yield {
(CurrentConsumerJsonV600(consumer.consumerId.get, callCountersJson), HttpCode.`200`(callContext))
(CurrentConsumerJsonV600(consumer.name.get, consumer.appType.get, consumer.description.get, consumer.consumerId.get, callCountersJson), HttpCode.`200`(callContext))
}
}
}

View File

@ -68,6 +68,9 @@ case class TokenJSON(
)
case class CurrentConsumerJsonV600(
app_name: String,
app_type: String,
description: String,
consumer_id: String,
call_counters: RedisCallCountersJsonV600
)

View File

@ -94,6 +94,12 @@ class ConsumerTest extends V600ServerSetup {
consumerJson.consumer_id should not be empty
consumerJson.consumer_id should not be null
consumerJson.consumer_id shouldBe a[String]
// consumerJson.app_name should not be empty (can be empty)
consumerJson.app_name shouldBe a[String]
// consumerJson.app_type should not be empty (can be empty)
consumerJson.app_type shouldBe a[String]
// consumerJson.description should not be empty (can be empty)
consumerJson.description shouldBe a[String]
consumerJson.call_counters should not be null
consumerJson.call_counters.per_second should not be null
consumerJson.call_counters.per_minute should not be null