build( resourceType: 'transportRule', sourceSurface: ExchangePowerShellCommandContracts::SOURCE_SURFACE, commandContractName: 'Get-TransportRule', commandContractVersion: ExchangePowerShellCommandContracts::COMMAND_CONTRACT_VERSION, payloadShapeVersion: ExchangePowerShellTargetEvidenceNormalizer::PAYLOAD_SHAPE_VERSION, normalizerVersion: 'exchange-transport-rule-readiness-v1', normalizedPayload: [ 'canonical_type' => 'transportRule', 'material' => ['enabled' => true], ], ); $json = $builder->canonicalJson($input); expect($input)->toMatchArray([ 'resource_type' => 'transportRule', 'source_surface' => ExchangePowerShellCommandContracts::SOURCE_SURFACE, 'command_contract_name' => 'Get-TransportRule', 'command_contract_version' => ExchangePowerShellCommandContracts::COMMAND_CONTRACT_VERSION, 'payload_shape_version' => ExchangePowerShellTargetEvidenceNormalizer::PAYLOAD_SHAPE_VERSION, 'normalizer_version' => 'exchange-transport-rule-readiness-v1', ]) ->and($json) ->not->toContain('raw_stdout') ->not->toContain('raw_stderr') ->not->toContain('operation_run') ->not->toContain('credential') ->not->toContain('permission'); }); it('Spec435 hash previews change when normalizer version or target type changes', function (): void { $builder = app(ExchangePowerShellHashInputBuilder::class); $payload = ['canonical_type' => 'transportRule', 'material' => ['enabled' => true]]; $first = $builder->hash($builder->build( resourceType: 'transportRule', sourceSurface: ExchangePowerShellCommandContracts::SOURCE_SURFACE, commandContractName: 'Get-TransportRule', commandContractVersion: ExchangePowerShellCommandContracts::COMMAND_CONTRACT_VERSION, payloadShapeVersion: ExchangePowerShellTargetEvidenceNormalizer::PAYLOAD_SHAPE_VERSION, normalizerVersion: 'exchange-transport-rule-readiness-v1', normalizedPayload: $payload, )); $versionChanged = $builder->hash($builder->build( resourceType: 'transportRule', sourceSurface: ExchangePowerShellCommandContracts::SOURCE_SURFACE, commandContractName: 'Get-TransportRule', commandContractVersion: ExchangePowerShellCommandContracts::COMMAND_CONTRACT_VERSION, payloadShapeVersion: ExchangePowerShellTargetEvidenceNormalizer::PAYLOAD_SHAPE_VERSION, normalizerVersion: 'exchange-transport-rule-readiness-v2', normalizedPayload: $payload, )); $targetChanged = $builder->hash($builder->build( resourceType: 'remoteDomain', sourceSurface: ExchangePowerShellCommandContracts::SOURCE_SURFACE, commandContractName: 'Get-RemoteDomain', commandContractVersion: ExchangePowerShellCommandContracts::COMMAND_CONTRACT_VERSION, payloadShapeVersion: ExchangePowerShellTargetEvidenceNormalizer::PAYLOAD_SHAPE_VERSION, normalizerVersion: 'exchange-transport-rule-readiness-v1', normalizedPayload: $payload, )); expect($first)->not->toBe($versionChanged) ->and($first)->not->toBe($targetChanged); });