@@ -64,6 +64,81 @@ function harness() {
6464afterEach ( ( ) => vi . useRealTimers ( ) )
6565
6666describe ( 'OCI Streaming request and response semantics' , ( ) => {
67+ it . each ( [ 'create_stream_pool' , 'get_stream_pool' , 'update_stream_pool' ] ) (
68+ 'projects inactive pool settings for %s without replaying the request' ,
69+ async ( operation ) => {
70+ const h = harness ( )
71+ const pool = {
72+ id : 'pool' ,
73+ name : 'events' ,
74+ compartmentId : 'compartment' ,
75+ lifecycleState : 'ACTIVE' ,
76+ timeCreated : '2026-01-01T00:00:00Z' ,
77+ kafkaSettings : { bootstrapServers : null } ,
78+ customEncryptionKey : { kmsKeyId : null , keyState : 'NONE' } ,
79+ privateEndpointSettings : { nsgIds : null , privateEndpointIp : null , subnetId : null } ,
80+ }
81+ h . request . mockResolvedValue ( response ( JSON . stringify ( pool ) , { etag : 'v1' } ) )
82+ const params =
83+ operation === 'create_stream_pool'
84+ ? { name : 'events' , compartmentId : 'compartment' }
85+ : operation === 'update_stream_pool'
86+ ? { streamPoolId : 'pool' , name : 'events' }
87+ : { streamPoolId : 'pool' }
88+ const result = await h . execute ( { operation, ...params } )
89+ expect ( result . output ) . toMatchObject ( {
90+ streamPool : {
91+ ...pool ,
92+ kafkaSettings : { bootstrapServers : undefined } ,
93+ customEncryptionKey : { kmsKeyId : undefined , keyState : 'NONE' } ,
94+ privateEndpointSettings : {
95+ nsgIds : undefined ,
96+ privateEndpointIp : undefined ,
97+ subnetId : undefined ,
98+ } ,
99+ } ,
100+ etag : 'v1' ,
101+ } )
102+ expect ( h . request ) . toHaveBeenCalledTimes ( 1 )
103+ }
104+ )
105+
106+ it ( 'preserves populated pool settings and rejects malformed settings' , async ( ) => {
107+ const h = harness ( )
108+ const pool = {
109+ id : 'pool' ,
110+ name : 'events' ,
111+ compartmentId : 'compartment' ,
112+ lifecycleState : 'ACTIVE' ,
113+ timeCreated : '2026-01-01T00:00:00Z' ,
114+ kafkaSettings : { bootstrapServers : 'server:9092' } ,
115+ customEncryptionKey : { kmsKeyId : 'key' } ,
116+ privateEndpointSettings : {
117+ nsgIds : [ 'nsg' ] ,
118+ privateEndpointIp : '10.0.0.1' ,
119+ subnetId : 'subnet' ,
120+ } ,
121+ }
122+ h . request . mockResolvedValue ( response ( JSON . stringify ( pool ) ) )
123+ expect (
124+ ( await h . execute ( { operation : 'get_stream_pool' , streamPoolId : 'pool' } ) ) . output . streamPool
125+ ) . toEqual ( pool )
126+ h . request . mockResolvedValue (
127+ response ( JSON . stringify ( { ...pool , privateEndpointSettings : { nsgIds : 'nsg' } } ) )
128+ )
129+ await expect (
130+ h . execute ( { operation : 'get_stream_pool' , streamPoolId : 'pool' } )
131+ ) . rejects . toThrow ( )
132+ expect (
133+ ociStreamingInputSchema . safeParse ( {
134+ operation : 'create_stream_pool' ,
135+ ociCredential : 'credential' ,
136+ name : 'events' ,
137+ compartmentId : 'compartment' ,
138+ customEncryptionKeyDetails : { kmsKeyId : null } ,
139+ } ) . success
140+ ) . toBe ( false )
141+ } )
67142 it ( 'accepts full resource names, bounds group paths, and preserves empty tag updates' , ( ) => {
68143 const create = {
69144 operation : 'create_stream' ,
0 commit comments