@@ -70,16 +70,10 @@ def step_impl(context: MinifiTestContext, processor_type: str, property_name: st
7070 context .containers ["nifi" ].flow_definition .add_processor (processor )
7171
7272
73- @given ('a {processor_type} processor with the name "{processor_name}" in the "{minifi_container_name}" flow' )
74- def step_impl (context : MinifiTestContext , processor_type : str , processor_name : str , minifi_container_name : str ):
75- processor = Processor (processor_type , processor_name )
76- context .get_or_create_minifi_container (minifi_container_name ).flow_definition .add_processor (processor )
77-
78-
7973@given ('a {processor_type} processor with the name "{processor_name}"' )
8074def step_impl (context : MinifiTestContext , processor_type : str , processor_name : str ):
81- context . execute_steps (
82- f'given a { processor_type } processor with the name " { processor_name } " in the " { DEFAULT_MINIFI_CONTAINER_NAME } " flow' )
75+ processor = Processor ( processor_type , processor_name )
76+ context . get_or_create_default_minifi_container (). flow_definition . add_processor ( processor )
8377
8478
8579@given ("a {processor_type} processor in the \" {minifi_container_name}\" flow" )
@@ -99,17 +93,6 @@ def step_impl(context: MinifiTestContext, processor_type: str):
9993 context .execute_steps (f'given a { processor_type } processor in the "{ DEFAULT_MINIFI_CONTAINER_NAME } " flow' )
10094
10195
102- @given ('the "{property_name}" property of the "{port_name}" port in the "{rpg_name}" remote process group is set to "{property_value}"' )
103- def step_impl (context : MinifiTestContext , property_name : str , port_name : str , rpg_name : str , property_value : str ):
104- rpg = context .get_or_create_minifi_container (DEFAULT_MINIFI_CONTAINER_NAME ).flow_definition .get_remote_process_group (rpg_name )
105- if not rpg :
106- raise ValueError (f"Remote Process Group with name { rpg_name } not found" )
107- port = rpg .get_input_port (port_name )
108- if not port :
109- raise ValueError (f"Remote input port with name { port_name } not found in RPG { rpg_name } " )
110- port .add_property (property_name , property_value )
111-
112-
11396@given ('the "{property_name}" property of the {processor_name} processor is set to "{property_value}" in the "{minifi_container_name}" flow' )
11497def step_impl (context : MinifiTestContext , property_name : str , processor_name : str , property_value : str , minifi_container_name : str ):
11598 processor = context .get_or_create_minifi_container (minifi_container_name ).flow_definition .get_processor (processor_name )
@@ -149,7 +132,6 @@ def step_impl(context: MinifiTestContext, funnel_name: str):
149132
150133
151134@step ('in the "{minifi_container_name}" flow the "{relationship_name}" relationship of the {source} processor is connected to the {target}' )
152- @step ('in the "{minifi_container_name}" flow the "{relationship_name}" relationship of the {source} node is connected to the {target}' )
153135def step_impl (context : MinifiTestContext , relationship_name : str , source : str , target : str , minifi_container_name : str ):
154136 connection = Connection (source_name = source , source_relationship = relationship_name , target_name = target )
155137 context .get_or_create_minifi_container (minifi_container_name ).flow_definition .add_connection (connection )
@@ -162,17 +144,10 @@ def step_impl(context: MinifiTestContext, relationship_name: str, source: str, t
162144
163145
164146@step ('the "{relationship_name}" relationship of the {source} processor is connected to the {target}' )
165- @step ('the "{relationship_name}" relationship of the {source} node is connected to the {target}' )
166147def step_impl (context : MinifiTestContext , relationship_name : str , source : str , target : str ):
167148 context .execute_steps (f'given in the "{ DEFAULT_MINIFI_CONTAINER_NAME } " flow the "{ relationship_name } " relationship of the { source } processor is connected to the { target } ' )
168149
169150
170- @step ("the output port \" {port_name}\" is connected to the {destination_name} processor" )
171- def step_impl (context : MinifiTestContext , port_name : str , destination_name : str ):
172- connection = Connection (source_name = port_name , source_relationship = "undefined" , target_name = destination_name )
173- context .get_or_create_minifi_container (DEFAULT_MINIFI_CONTAINER_NAME ).flow_definition .add_connection (connection )
174-
175-
176151@step ('the Funnel with the name "{funnel_name}" is connected to the {target}' )
177152def step_impl (context : MinifiTestContext , funnel_name : str , target : str ):
178153 connection = Connection (source_name = funnel_name , source_relationship = "success" , target_name = target )
@@ -370,50 +345,3 @@ def step_impl(context: MinifiTestContext, processor_name):
370345 add_ssl_context_service_for_minifi (context , "minifi_client" , use_system_cert_store = True )
371346 processor = context .get_or_create_default_minifi_container ().flow_definition .get_processor (processor_name )
372347 processor .add_property ('SSL Context Service' , 'SSLContextService' )
373-
374-
375- @given ("a RemoteProcessGroup node with name \" {rpg_name}\" is opened on \" {address}\" with transport protocol set to \" {transport_protocol}\" " )
376- def step_impl (context : MinifiTestContext , rpg_name : str , address : str , transport_protocol : str ):
377- context .get_or_create_default_minifi_container ().flow_definition .add_remote_process_group (address , rpg_name , transport_protocol )
378-
379-
380- @given ("a RemoteProcessGroup node with name \" {rpg_name}\" is opened on \" {address}\" " )
381- def step_impl (context : MinifiTestContext , rpg_name : str , address : str ):
382- context .execute_steps (f"given a RemoteProcessGroup node with name \" { rpg_name } \" is opened on \" { address } \" with transport protocol set to \" RAW\" " )
383-
384-
385- @given ("an input port with name \" {port_name}\" is created on the RemoteProcessGroup named \" {rpg_name}\" " )
386- def step_impl (context : MinifiTestContext , port_name : str , rpg_name : str ):
387- context .get_or_create_default_minifi_container ().flow_definition .add_input_port_to_rpg (rpg_name , port_name )
388-
389-
390- @given ("an input port using compression with name \" {port_name}\" is created on the RemoteProcessGroup named \" {rpg_name}\" " )
391- def step_impl (context : MinifiTestContext , port_name : str , rpg_name : str ):
392- context .get_or_create_default_minifi_container ().flow_definition .add_input_port_to_rpg (rpg_name , port_name , use_compression = True )
393-
394-
395- @given ("an output port with name \" {port_name}\" is created on the RemoteProcessGroup named \" {rpg_name}\" " )
396- def step_impl (context : MinifiTestContext , port_name : str , rpg_name : str ):
397- context .get_or_create_default_minifi_container ().flow_definition .add_output_port_to_rpg (rpg_name , port_name )
398-
399-
400- @given ("an output port using compression with name \" {port_name}\" is created on the RemoteProcessGroup named \" {rpg_name}\" " )
401- def step_impl (context : MinifiTestContext , port_name : str , rpg_name : str ):
402- context .get_or_create_default_minifi_container ().flow_definition .add_output_port_to_rpg (rpg_name , port_name , use_compression = True )
403-
404-
405- @given ("a NiFi flow is receiving data from the RemoteProcessGroup named \" {rpg_name}\" in an input port named \" {input_port_name}\" which has the same id as the port named \" {rpg_port_name}\" " )
406- def step_impl (context : MinifiTestContext , input_port_name : str , rpg_port_name : str , rpg_name : str ):
407- input_port_id = context .get_or_create_default_minifi_container ().flow_definition .get_input_port_id_of_rpg (rpg_name , rpg_port_name )
408- context .containers ["nifi" ].flow_definition .add_input_port (input_port_id , input_port_name )
409-
410-
411- @given ("a NiFi flow is sending data to an output port named \" {port_name}\" with the id of the port named \" {rpg_port_name}\" from the RemoteProcessGroup named \" {rpg_name}\" " )
412- def step_impl (context : MinifiTestContext , port_name : str , rpg_port_name : str , rpg_name : str ):
413- output_port_id = context .get_or_create_default_minifi_container ().flow_definition .get_output_port_id_of_rpg (rpg_name , rpg_port_name )
414- context .containers ["nifi" ].flow_definition .add_output_port (output_port_id , port_name )
415-
416-
417- @given ("the connection going to {destination} has \" drop empty\" set" )
418- def step_impl (context : MinifiTestContext , destination : str ):
419- context .get_or_create_default_minifi_container ().flow_definition .set_drop_empty_for_destination (destination )
0 commit comments