Skip to content

Commit

Permalink
Fix scenario with correlator
Browse files Browse the repository at this point in the history
  • Loading branch information
pratid committed Nov 29, 2016
1 parent 0615237 commit 110c8cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Expand Up @@ -148,14 +148,14 @@ Feature: Sending probe data
| ABC_1av |


Scenario Outline: NGSI-Adapter generates new transaction-id value when header is missing or empty
Scenario Outline: NGSI Adapter generates new correlator value when header is missing or empty
Given the probe name "<probe_name>"
And the monitored resource with id "qa:1234567890" and type "host"
And the header Transaction-Id "<transaction_id>"
And the header Correlator "<correlator>"
When I send raw data according to the selected probe
Then an auto-generated Transaction-Id value is used in logs
Then an auto-generated Correlator value is used in logs

Examples:
| transaction_id | probe_name |
| | no_transaction |
| [MISSING_PARAM] | no_transaction2 |
| correlator | probe_name |
| | no_correlator |
| [MISSING_PARAM] | no_correlator2 |
Expand Up @@ -96,10 +96,10 @@ def the_response_status_code_is(step, status_code):
@step(u'the header Correlator "(.*)"$')
def the_header_correlator(step, correlator):
world.correlator = prepare_param(correlator)
world.ngsi_adapter_client.init_headers(correlator=world.correlator)
world.ngsi_adapter_client.init_headers(correlator=world.correlator, auth_token=world.auth_token)


@step(u'an auto-generated Transaction-Id value is used in logs')
@step(u'an auto-generated Correlator value is used in logs')
@step(u'the given Correlator value is used in logs')
def the_given_correlator_value_is_used_in_logs(step):
log_utils = LogUtils()
Expand Down
Expand Up @@ -41,14 +41,14 @@ def before_all():

@before.each_feature
def before_each_feature(feature):
auth_token = world.config[MONITORING_CONFIG_SERVICE_ADAPTER][MONITORING_CONFIG_SERVICE_AUTH_TOKEN]
world.auth_token = world.config[MONITORING_CONFIG_SERVICE_ADAPTER][MONITORING_CONFIG_SERVICE_AUTH_TOKEN]
world.ngsi_adapter_client = NgsiAdapterClient(world.config[MONITORING_CONFIG_SERVICE_ADAPTER]
[MONITORING_CONFIG_SERVICE_PROTOCOL],
world.config[MONITORING_CONFIG_SERVICE_ADAPTER]
[MONITORING_CONFIG_SERVICE_HOST],
world.config[MONITORING_CONFIG_SERVICE_ADAPTER]
[MONITORING_CONFIG_SERVICE_PORT],
auth_token=auth_token)
auth_token=world.auth_token)


@before.each_scenario
Expand Down

0 comments on commit 110c8cd

Please sign in to comment.