[More Detail] [Collapse All]
Feature: Pass input using query parameters

Operation '/customer(get)' uses query parameters.
features/045-pass-input-parameters/001-query-parameter.feature
- Background:
link
features/045-pass-input-parameters/001-query-parameter.feature:8
Given I use a fixture named "fixture-resolver"
And YAML configuration file `cnf/sbuilder.yaml`
#
# 'setups' section defines a setup 'setup1' and uses configuration
#  file 'cnf/extend_setup1.yaml'

setups:
- setupDirectory: setup1
  extensions:
      -  url: cnf/extend_setup1.yaml
And YAML configuration file `cnf/sbuilder.yaml`
#
# 'resolvers' section in 'sbuilder.yaml' loads resolvers from file
# 'cnf/resolver_customer.yaml'

resolvers:
      - url: cnf/resolver.yaml
And a file named "cnf/resolver.yaml" with:
# default resolver with one regexp rule maps 
# all parameters to domain 'dommi'
#
-    Name: default-relsolver
     Matcher: !ruby/regexp /.*/
     Rules: 
      - Matcher: !ruby/regexp /.*/
        Domain: dommi
- Scenario: Pass array of signeleton queyry parameters to /customer(get)
link
features/045-pass-input-parameters/001-query-parameter.feature:50
# NOTICE: see problem problem description for 'ProcessParameterEnables' in
# plc_define_run.mustache. Singleton array input are not currently supported
# ------------------------------------------------------------------
# Swagger configuration
Given YAML configuration file `cnf/interface_customer.yaml` in path `paths./customer.get`
     operationId: findCustomers by id
     parameters:
       - name: id
         in: query
         description: tags to filter by
         required: false
         # type: string
         type: array
         collectionFormat: csv
         items:
           type: string
       - name: tag
         in: query
         description: maximum number of results to return
         required: false
         type: integer
         format: int32
     responses:
        200:
           description: OK
And a file named "cnf/extend_setup1.yaml" with:
# Setup1:
# - sets cardinality for domain 'dommi'
# - lauch: operation /customer(get), sets domain values for query parameters
#
- domain-extension:
   - domain: dommi
     cardinality: 3
- step-extension:
  - interface: /customer(get)
    input:
       id:
        - 0
        - 1
       tag: 2
When I generate TLA+ model setup `setup1`
And I do PLC transformation for setup `setup1`
And I run TLC for setup `setup1`
And I can observe operation `/customer(get)` called on time tick `0`
And I can observe domain assignement:
Field Domain
id {Nil, "d_dommi_1"}
tag "d_dommi_2"
- Scenario: Pass queyry parameters to /customer(get)
link
features/045-pass-input-parameters/001-query-parameter.feature:108
# ------------------------------------------------------------------
# Swagger configuration
Given YAML configuration file `cnf/interface_customer.yaml` in path `paths./customer.get`
     operationId: findCustomers by id
     parameters:
       - name: id
         in: query
         description: tags to filter by
         required: false
         type: string
         # type: array
         # collectionFormat: csv
         # items:
         #   type: string
       - name: tag
         in: query
         description: maximum number of results to return
         required: false
         type: integer
         format: int32
     responses:
        200:
           description: OK
And a file named "cnf/extend_setup1.yaml" with:
# Setup1:
# - sets cardinality for domain 'dommi'
# - lauch: operation /customer(get), sets domain values for query parameters
#
- domain-extension:
   - domain: dommi
     cardinality: 3
- step-extension:
  - interface: /customer(get)
    input:
       id: 1
        # - 1
       tag: 2
When I generate TLA+ model setup `setup1`
And I do PLC transformation for setup `setup1`
And I run TLC for setup `setup1`
And I can observe operation `/customer(get)` called on time tick `0`
And I can observe domain assignement:
Field Domain
id "d_dommi_1"
tag "d_dommi_2"