diff --git a/src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/SpannerMeasurementConsumersService.kt b/src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/SpannerMeasurementConsumersService.kt index bc95aee54a2..1b05951e6d8 100644 --- a/src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/SpannerMeasurementConsumersService.kt +++ b/src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/SpannerMeasurementConsumersService.kt @@ -15,7 +15,6 @@ package org.wfanet.measurement.kingdom.deploy.gcloud.spanner import io.grpc.Status -import org.wfanet.measurement.common.grpc.failGrpc import org.wfanet.measurement.common.grpc.grpcRequire import org.wfanet.measurement.common.identity.ExternalId import org.wfanet.measurement.common.identity.IdGenerator @@ -78,12 +77,12 @@ class SpannerMeasurementConsumersService( override suspend fun getMeasurementConsumer( request: GetMeasurementConsumerRequest ): MeasurementConsumer { + val externalMeasurementConsumerId = ExternalId(request.externalMeasurementConsumerId) return MeasurementConsumerReader() - .readByExternalMeasurementConsumerId( - client.singleUse(), - ExternalId(request.externalMeasurementConsumerId), - ) - ?.measurementConsumer ?: failGrpc(Status.NOT_FOUND) { "MeasurementConsumer not found" } + .readByExternalMeasurementConsumerId(client.singleUse(), externalMeasurementConsumerId) + ?.measurementConsumer + ?: throw MeasurementConsumerNotFoundException(externalMeasurementConsumerId) + .asStatusRuntimeException(Status.Code.NOT_FOUND, "MeasurementConsumer not found") } override suspend fun addMeasurementConsumerOwner( diff --git a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel index 14a54bea91f..110fa8e8beb 100644 --- a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel @@ -288,6 +288,7 @@ kt_jvm_library( "//src/main/kotlin/org/wfanet/measurement/api/v2alpha:packed_messages", "//src/main/kotlin/org/wfanet/measurement/api/v2alpha:principal_server_interceptor", "//src/main/kotlin/org/wfanet/measurement/api/v2alpha:resource_key", + "//src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha:internal_status_conversion", "//src/main/proto/wfa/measurement/api/v2alpha:crypto_kt_jvm_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumer_kt_jvm_proto", "//src/main/proto/wfa/measurement/api/v2alpha:measurement_consumers_service_kt_jvm_grpc_proto", diff --git a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/InternalStatusConversion.kt b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/InternalStatusConversion.kt index 9a4de1e81ce..c5cb03fd8a0 100644 --- a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/InternalStatusConversion.kt +++ b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/InternalStatusConversion.kt @@ -86,7 +86,7 @@ fun Status.toExternalStatusRuntimeException( ) ) .toName() - put("measurement_consumer", measurementConsumerName) + put("measurementConsumer", measurementConsumerName) errorMessage = "MeasurementConsumer $measurementConsumerName not found." } ErrorCode.DATA_PROVIDER_NOT_FOUND -> { @@ -302,7 +302,7 @@ fun Status.toExternalStatusRuntimeException( .toActivationState() .toString() put("account", accountName) - put("account_activation_state", accountActivationState) + put("accountActivationState", accountActivationState) errorMessage = "Account $accountName is in illegal activation state: $accountActivationState." } diff --git a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementConsumersService.kt b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementConsumersService.kt index 24d8b4f452f..c0af66aae1b 100644 --- a/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementConsumersService.kt +++ b/src/main/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementConsumersService.kt @@ -101,18 +101,13 @@ class MeasurementConsumersService( val internalMeasurementConsumer = try { internalClient.createMeasurementConsumer(createRequest) - } catch (ex: StatusException) { - when (ex.status.code) { - Status.Code.INVALID_ARGUMENT -> - failGrpc(Status.INVALID_ARGUMENT, ex) { "Required field unspecified or invalid." } - Status.Code.PERMISSION_DENIED -> - failGrpc(Status.PERMISSION_DENIED, ex) { - "Measurement Consumer creation token is not valid." - } - Status.Code.FAILED_PRECONDITION -> - failGrpc(Status.FAILED_PRECONDITION, ex) { "Account not found or inactivated." } - else -> failGrpc(Status.UNKNOWN, ex) { "Unknown exception." } - } + } catch (e: StatusException) { + throw when (e.status.code) { + Status.Code.INVALID_ARGUMENT -> Status.INVALID_ARGUMENT + Status.Code.PERMISSION_DENIED -> Status.PERMISSION_DENIED + Status.Code.FAILED_PRECONDITION -> Status.FAILED_PRECONDITION + else -> Status.UNKNOWN + }.toExternalStatusRuntimeException(e) } return internalMeasurementConsumer.toMeasurementConsumer() @@ -152,12 +147,11 @@ class MeasurementConsumersService( val internalResponse = try { internalClient.getMeasurementConsumer(getRequest) - } catch (ex: StatusException) { - when (ex.status.code) { - Status.Code.NOT_FOUND -> - failGrpc(Status.NOT_FOUND, ex) { "MeasurementConsumer not found" } - else -> failGrpc(Status.UNKNOWN, ex) { "Unknown exception." } - } + } catch (e: StatusException) { + throw when (e.status.code) { + Status.Code.NOT_FOUND -> Status.NOT_FOUND + else -> Status.UNKNOWN + }.toExternalStatusRuntimeException(e) } return internalResponse.toMeasurementConsumer() @@ -191,14 +185,12 @@ class MeasurementConsumersService( val internalMeasurementConsumer = try { internalClient.addMeasurementConsumerOwner(internalAddMeasurementConsumerOwnerRequest) - } catch (ex: StatusException) { - when (ex.status.code) { - Status.Code.FAILED_PRECONDITION -> - failGrpc(Status.FAILED_PRECONDITION, ex) { "Account not found." } - Status.Code.NOT_FOUND -> - failGrpc(Status.NOT_FOUND, ex) { "MeasurementConsumer not found." } - else -> failGrpc(Status.UNKNOWN, ex) { "Unknown exception." } - } + } catch (e: StatusException) { + throw when (e.status.code) { + Status.Code.FAILED_PRECONDITION -> Status.FAILED_PRECONDITION + Status.Code.NOT_FOUND -> Status.NOT_FOUND + else -> Status.UNKNOWN + }.toExternalStatusRuntimeException(e) } return internalMeasurementConsumer.toMeasurementConsumer() } @@ -231,16 +223,12 @@ class MeasurementConsumersService( val internalMeasurementConsumer = try { internalClient.removeMeasurementConsumerOwner(internalRemoveMeasurementConsumerOwnerRequest) - } catch (ex: StatusException) { - when (ex.status.code) { - Status.Code.FAILED_PRECONDITION -> - failGrpc(Status.FAILED_PRECONDITION, ex) { - "Account not found or Account doesn't own the MeasurementConsumer." - } - Status.Code.NOT_FOUND -> - failGrpc(Status.NOT_FOUND, ex) { "MeasurementConsumer not found." } - else -> failGrpc(Status.UNKNOWN, ex) { "Unknown exception." } - } + } catch (e: StatusException) { + throw when (e.status.code) { + Status.Code.FAILED_PRECONDITION -> Status.FAILED_PRECONDITION + Status.Code.NOT_FOUND -> Status.NOT_FOUND + else -> Status.UNKNOWN + }.toExternalStatusRuntimeException(e) } return internalMeasurementConsumer.toMeasurementConsumer() } diff --git a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/AccountsServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/AccountsServiceTest.kt index e1b21676b8f..347cacd7c8d 100644 --- a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/AccountsServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/AccountsServiceTest.kt @@ -528,7 +528,7 @@ class AccountsServiceTest { assertThat(exception.status.code).isEqualTo(Status.Code.PERMISSION_DENIED) assertThat(exception.errorInfo?.metadataMap) - .containsEntry("account_activation_state", Account.ActivationState.ACTIVATED.toString()) + .containsEntry("accountActivationState", Account.ActivationState.ACTIVATED.toString()) assertThat(exception.errorInfo?.metadataMap).containsEntry("account", ACCOUNT_NAME) } diff --git a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/ApiKeysServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/ApiKeysServiceTest.kt index cd7b35afba2..a2f1e82209b 100644 --- a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/ApiKeysServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/ApiKeysServiceTest.kt @@ -207,7 +207,7 @@ class ApiKeysServiceTest { assertThat(exception.status.code).isEqualTo(Status.Code.NOT_FOUND) assertThat(exception.errorInfo?.metadataMap) - .containsEntry("measurement_consumer", MEASUREMENT_CONSUMER_NAME) + .containsEntry("measurementConsumer", MEASUREMENT_CONSUMER_NAME) } @Test diff --git a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel index 47575b33310..716581128f5 100644 --- a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/BUILD.bazel @@ -236,6 +236,7 @@ kt_jvm_test( test_class = "org.wfanet.measurement.kingdom.service.api.v2alpha.MeasurementConsumersServiceTest", deps = [ "//src/main/kotlin/org/wfanet/measurement/api/v2alpha/testing", + "//src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/common", "//src/main/proto/wfa/measurement/internal/kingdom:measurement_consumers_service_kt_jvm_grpc_proto", "@wfa_common_jvm//imports/java/com/google/common/truth", "@wfa_common_jvm//imports/java/com/google/common/truth/extensions/proto", diff --git a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementConsumersServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementConsumersServiceTest.kt index 2f469475057..a5b83fb4271 100644 --- a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementConsumersServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementConsumersServiceTest.kt @@ -29,7 +29,9 @@ import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 import org.mockito.kotlin.any +import org.mockito.kotlin.stub import org.wfanet.measurement.api.Version +import org.wfanet.measurement.api.v2alpha.Account import org.wfanet.measurement.api.v2alpha.GetMeasurementConsumerRequest import org.wfanet.measurement.api.v2alpha.MeasurementConsumer import org.wfanet.measurement.api.v2alpha.MeasurementConsumerCertificateKey @@ -49,15 +51,17 @@ import org.wfanet.measurement.common.crypto.readCertificate import org.wfanet.measurement.common.crypto.subjectKeyIdentifier import org.wfanet.measurement.common.crypto.testing.TestData import org.wfanet.measurement.common.crypto.tink.loadPublicKey +import org.wfanet.measurement.common.grpc.errorInfo import org.wfanet.measurement.common.grpc.testing.GrpcTestServerRule import org.wfanet.measurement.common.grpc.testing.mockService +import org.wfanet.measurement.common.identity.ExternalId import org.wfanet.measurement.common.identity.apiIdToExternalId import org.wfanet.measurement.common.identity.externalIdToApiId import org.wfanet.measurement.common.pack import org.wfanet.measurement.common.testing.verifyProtoArgument import org.wfanet.measurement.common.toProtoTime import org.wfanet.measurement.consent.client.common.toEncryptionPublicKey -import org.wfanet.measurement.internal.kingdom.Account +import org.wfanet.measurement.internal.kingdom.Account as InternalAccount import org.wfanet.measurement.internal.kingdom.CertificateKt import org.wfanet.measurement.internal.kingdom.MeasurementConsumer as InternalMeasurementConsumer import org.wfanet.measurement.internal.kingdom.MeasurementConsumerKt.details @@ -71,6 +75,10 @@ import org.wfanet.measurement.internal.kingdom.createMeasurementConsumerRequest import org.wfanet.measurement.internal.kingdom.getMeasurementConsumerRequest as internalGetMeasurementConsumerRequest import org.wfanet.measurement.internal.kingdom.measurementConsumer as internalMeasurementConsumer import org.wfanet.measurement.internal.kingdom.removeMeasurementConsumerOwnerRequest as internalRemoveMeasurementConsumerOwnerRequest +import org.wfanet.measurement.kingdom.deploy.gcloud.spanner.common.AccountActivationStateIllegalException +import org.wfanet.measurement.kingdom.deploy.gcloud.spanner.common.AccountNotFoundException +import org.wfanet.measurement.kingdom.deploy.gcloud.spanner.common.MeasurementConsumerNotFoundException +import org.wfanet.measurement.kingdom.deploy.gcloud.spanner.common.PermissionDeniedException private const val MEASUREMENT_CONSUMER_ID = 123L private const val ACCOUNT_ID = 123L @@ -506,6 +514,236 @@ class MeasurementConsumersServiceTest { ) } + @Test + fun `createMeasurementConsumer throws PERMISSION_DENIED when measurement consumer creation token not valid`() { + internalServiceMock.stub { + onBlocking { createMeasurementConsumer(any()) } + .thenThrow( + PermissionDeniedException() + .asStatusRuntimeException( + Status.Code.PERMISSION_DENIED, + "Measurement Consumer creation token is not valid.", + ) + ) + } + val request = createMeasurementConsumerRequest { + measurementConsumer = measurementConsumer { + certificateDer = SERVER_CERTIFICATE_DER + publicKey = SIGNED_PUBLIC_KEY + measurementConsumerCreationToken = "VzmtXavLdk4" + } + } + val exception = + assertFailsWith { + withAccount(ACTIVATED_INTERNAL_ACCOUNT) { + runBlocking { service.createMeasurementConsumer(request) } + } + } + + assertThat(exception.status.code).isEqualTo(Status.Code.PERMISSION_DENIED) + } + + @Test + fun `createMeasurementConsumer throws FAILED_PRECONDITION with account name when account not found`() { + internalServiceMock.stub { + onBlocking { createMeasurementConsumer(any()) } + .thenThrow( + AccountNotFoundException(ExternalId(ACCOUNT_ID)) + .asStatusRuntimeException(Status.Code.FAILED_PRECONDITION, "Account was not found.") + ) + } + val request = createMeasurementConsumerRequest { + measurementConsumer = measurementConsumer { + certificateDer = SERVER_CERTIFICATE_DER + publicKey = SIGNED_PUBLIC_KEY + measurementConsumerCreationToken = MEASUREMENT_CONSUMER_CREATION_TOKEN + } + } + val exception = + assertFailsWith { + withAccount(ACTIVATED_INTERNAL_ACCOUNT) { + runBlocking { service.createMeasurementConsumer(request) } + } + } + + assertThat(exception.status.code).isEqualTo(Status.Code.FAILED_PRECONDITION) + assertThat(exception.errorInfo?.metadataMap).containsEntry("account", ACCOUNT_NAME) + } + + @Test + fun `createMeasurementConsumer throws FAILED_PRECONDITION with account name and state when account activation state illegal`() { + internalServiceMock.stub { + onBlocking { createMeasurementConsumer(any()) } + .thenThrow( + AccountActivationStateIllegalException( + ExternalId(ACCOUNT_ID), + InternalAccount.ActivationState.UNACTIVATED, + ) + .asStatusRuntimeException( + Status.Code.FAILED_PRECONDITION, + "Account activation state illegal.", + ) + ) + } + val request = createMeasurementConsumerRequest { + measurementConsumer = measurementConsumer { + certificateDer = SERVER_CERTIFICATE_DER + publicKey = SIGNED_PUBLIC_KEY + measurementConsumerCreationToken = MEASUREMENT_CONSUMER_CREATION_TOKEN + } + } + val exception = + assertFailsWith { + withAccount( + ACTIVATED_INTERNAL_ACCOUNT.copy { + activationState = InternalAccount.ActivationState.UNACTIVATED + } + ) { + runBlocking { service.createMeasurementConsumer(request) } + } + } + + assertThat(exception.status.code).isEqualTo(Status.Code.FAILED_PRECONDITION) + assertThat(exception.errorInfo?.metadataMap).containsEntry("account", ACCOUNT_NAME) + assertThat(exception.errorInfo?.metadataMap) + .containsEntry("accountActivationState", Account.ActivationState.UNACTIVATED.toString()) + } + + @Test + fun `getMeasurementConsumer throws NOT_FOUND with measurement consumer name when measurement consumer not found`() { + internalServiceMock.stub { + onBlocking { getMeasurementConsumer(any()) } + .thenThrow( + MeasurementConsumerNotFoundException(ExternalId(MEASUREMENT_CONSUMER_ID)) + .asStatusRuntimeException(Status.Code.NOT_FOUND, "MeasurementConsumer not found.") + ) + } + val exception = + assertFailsWith { + withMeasurementConsumerPrincipal(MEASUREMENT_CONSUMER_NAME) { + runBlocking { + service.getMeasurementConsumer( + getMeasurementConsumerRequest { name = MEASUREMENT_CONSUMER_NAME } + ) + } + } + } + + assertThat(exception.status.code).isEqualTo(Status.Code.NOT_FOUND) + assertThat(exception.errorInfo?.metadataMap) + .containsEntry("measurementConsumer", MEASUREMENT_CONSUMER_NAME) + } + + @Test + fun `addMeasurementConsumerOwner throws NOT_FOUND with measurement consumer name when measurement consumer not found`() { + internalServiceMock.stub { + onBlocking { addMeasurementConsumerOwner(any()) } + .thenThrow( + MeasurementConsumerNotFoundException(ExternalId(MEASUREMENT_CONSUMER_ID)) + .asStatusRuntimeException(Status.Code.NOT_FOUND, "MeasurementConsumer not found.") + ) + } + val exception = + assertFailsWith { + withAccount(ACTIVATED_INTERNAL_ACCOUNT) { + runBlocking { + service.addMeasurementConsumerOwner( + addMeasurementConsumerOwnerRequest { + name = MEASUREMENT_CONSUMER_NAME + account = ACCOUNT_NAME + } + ) + } + } + } + + assertThat(exception.status.code).isEqualTo(Status.Code.NOT_FOUND) + assertThat(exception.errorInfo?.metadataMap) + .containsEntry("measurementConsumer", MEASUREMENT_CONSUMER_NAME) + } + + @Test + fun `addMeasurementConsumerOwner throws FAILED_PRECONDITION with account name when account not found`() { + internalServiceMock.stub { + onBlocking { addMeasurementConsumerOwner(any()) } + .thenThrow( + AccountNotFoundException(ExternalId(ACCOUNT_ID)) + .asStatusRuntimeException(Status.Code.FAILED_PRECONDITION, "Account was not found.") + ) + } + val exception = + assertFailsWith { + withAccount(ACTIVATED_INTERNAL_ACCOUNT) { + runBlocking { + service.addMeasurementConsumerOwner( + addMeasurementConsumerOwnerRequest { + name = MEASUREMENT_CONSUMER_NAME + account = ACCOUNT_NAME + } + ) + } + } + } + + assertThat(exception.status.code).isEqualTo(Status.Code.FAILED_PRECONDITION) + assertThat(exception.errorInfo?.metadataMap).containsEntry("account", ACCOUNT_NAME) + } + + @Test + fun `removeMeasurementConsumerOwner throws FAILED_PRECONDITION with account name when account not found`() { + internalServiceMock.stub { + onBlocking { removeMeasurementConsumerOwner(any()) } + .thenThrow( + AccountNotFoundException(ExternalId(ACCOUNT_ID)) + .asStatusRuntimeException(Status.Code.FAILED_PRECONDITION, "Account was not found.") + ) + } + val exception = + assertFailsWith { + withAccount(ACTIVATED_INTERNAL_ACCOUNT) { + runBlocking { + service.removeMeasurementConsumerOwner( + removeMeasurementConsumerOwnerRequest { + name = MEASUREMENT_CONSUMER_NAME + account = ACCOUNT_NAME + } + ) + } + } + } + + assertThat(exception.status.code).isEqualTo(Status.Code.FAILED_PRECONDITION) + assertThat(exception.errorInfo?.metadataMap).containsEntry("account", ACCOUNT_NAME) + } + + @Test + fun `removeMeasurementConsumerOwner throws NOT_FOUND with measurement consumer name when measurement consumer not found`() { + internalServiceMock.stub { + onBlocking { removeMeasurementConsumerOwner(any()) } + .thenThrow( + MeasurementConsumerNotFoundException(ExternalId(MEASUREMENT_CONSUMER_ID)) + .asStatusRuntimeException(Status.Code.NOT_FOUND, "MeasurementConsumer not found.") + ) + } + val exception = + assertFailsWith { + withAccount(ACTIVATED_INTERNAL_ACCOUNT) { + runBlocking { + service.removeMeasurementConsumerOwner( + removeMeasurementConsumerOwnerRequest { + name = MEASUREMENT_CONSUMER_NAME + account = ACCOUNT_NAME + } + ) + } + } + } + + assertThat(exception.status.code).isEqualTo(Status.Code.NOT_FOUND) + assertThat(exception.errorInfo?.metadataMap) + .containsEntry("measurementConsumer", MEASUREMENT_CONSUMER_NAME) + } + companion object { private val API_VERSION = Version.V2_ALPHA @@ -550,9 +788,9 @@ class MeasurementConsumersServiceTest { publicKey = SIGNED_PUBLIC_KEY } - private val ACTIVATED_INTERNAL_ACCOUNT: Account = account { + private val ACTIVATED_INTERNAL_ACCOUNT: InternalAccount = account { externalAccountId = ACCOUNT_ID - activationState = Account.ActivationState.ACTIVATED + activationState = InternalAccount.ActivationState.ACTIVATED externalOwnedMeasurementConsumerId = MEASUREMENT_CONSUMER_ID externalOwnedMeasurementConsumerIds += MEASUREMENT_CONSUMER_ID } diff --git a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsServiceTest.kt index 5aea8861fb3..807609ea128 100644 --- a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/MeasurementsServiceTest.kt @@ -2552,7 +2552,7 @@ class MeasurementsServiceTest { } assertThat(exception.status.code).isEqualTo(Status.Code.NOT_FOUND) assertThat(exception.errorInfo?.metadataMap) - .containsEntry("measurement_consumer", MEASUREMENT_CONSUMER_NAME) + .containsEntry("measurementConsumer", MEASUREMENT_CONSUMER_NAME) } @Test @@ -2665,7 +2665,7 @@ class MeasurementsServiceTest { } assertThat(exception.status.code).isEqualTo(Status.Code.NOT_FOUND) assertThat(exception.errorInfo?.metadataMap) - .containsEntry("measurement_consumer", MEASUREMENT_CONSUMER_NAME) + .containsEntry("measurementConsumer", MEASUREMENT_CONSUMER_NAME) } @Test diff --git a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/PublicKeysServiceTest.kt b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/PublicKeysServiceTest.kt index 0e6fb5e0172..eae98bf9954 100644 --- a/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/PublicKeysServiceTest.kt +++ b/src/test/kotlin/org/wfanet/measurement/kingdom/service/api/v2alpha/PublicKeysServiceTest.kt @@ -395,7 +395,7 @@ class PublicKeysServiceTest { } assertThat(exception.status.code).isEqualTo(Status.Code.NOT_FOUND) assertThat(exception.errorInfo?.metadataMap) - .containsEntry("measurement_consumer", MEASUREMENT_CONSUMER_NAME) + .containsEntry("measurementConsumer", MEASUREMENT_CONSUMER_NAME) } companion object {