HAALCENTRAAL English translation
BRP API / Bewoning / Features / fout-cases-gba

Error cases when consulting occupancies

#language: en

@gba
Feature: Error cases when consulting occupancies

Rule: A valid consult type must be supplied

  @fout-case
  Scenario: no parameters have been supplied
    When gba occupancy is searched with the following parameters
    | naam | waarde |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: type.                        |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code     | name | reason                  |
    | required | type | Parameter is verplicht. |

  @fout-case
  Scenario: the 'type' parameter has not been supplied
    When gba occupancy is searched with the following parameters
    | naam                             | waarde               |
    | adresseerbaarObjectIdentificatie | 0800010000713450     |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: type.                        |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code     | name | reason                  |
    | required | type | Parameter is verplicht. |

  @fout-case
  Scenario Outline: a <omschrijving> has been supplied as the 'type' value
    When gba occupancy is searched with the following parameters
    | naam | waarde      |
    | type | <zoek type> |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1 |
    | title    | Een of meerdere parameters zijn niet correct.               |
    | status   | 400                                                         |
    | detail   | De foutieve parameter(s) zijn: type.                        |
    | code     | paramsValidation                                            |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |
    And the object has the following 'invalidParams' data
    | code  | name | reason                           |
    | value | type | Waarde is geen geldig zoek type. |

    Examples:
    | omschrijving                          | zoek type                  |
    | lege string                           |                            |
    | onbekend zoek type                    | BewoningMetGeslachtsnaam   |
    | geldig zoek type met verkeerde casing | bewoningmetpeildatum       |

Rule: The supported content type and charset for the response body are application/json and utf-8 respectively

  @fout-case
  Scenario: 'application/xml' has been supplied as the Accept content type
    When gba occupancy is searched with the following parameters
    | naam                             | waarde               |
    | type                             | BewoningMetPeildatum |
    | peildatum                        | gisteren             |
    | adresseerbaarObjectIdentificatie | 0800010000713450     |
    | header: Accept                   | application/xml      |
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.6 |
    | title    | Gevraagde content type wordt niet ondersteund.              |
    | detail   | Ondersteunde content type: application/json; charset=utf-8. |
    | code     | notAcceptable                                               |
    | status   | 406                                                         |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |

  Scenario Outline: '<accept media type>' is supplied as the Accept content type
    When gba occupancy is searched with the following parameters
    | naam                             | waarde               |
    | type                             | BewoningMetPeildatum |
    | peildatum                        | gisteren             |
    | adresseerbaarObjectIdentificatie | 0800010000713450     |
    | header: Accept                   | <accept media type>  |
    Then the response has 0 occupancies

    Examples:
    | accept media type               |
    | */*                             |
    | */*; charset=utf-8              |
    | */*;charset=utf-8               |
    | application/json                |
    | application/json; charset=utf-8 |
    | application/json;charset=utf-8  |
    | */*;charset=UTF-8               |
    | application/json;charset=Utf-8  |
    | application/json; charset=UTF-8 |

Rule: The default content type and charset for the response body are application/json and utf-8 respectively

  Scenario: no Accept header has been supplied
    When gba occupancy is searched with the following parameters
    | naam                             | waarde               |
    | type                             | BewoningMetPeildatum |
    | peildatum                        | gisteren             |
    | adresseerbaarObjectIdentificatie | 0800010000713450     |
    Then the response has 0 occupancies

  Scenario: an Accept header with an empty value has been supplied
    When gba occupancy is searched with the following parameters
    | naam                             | waarde               |
    | type                             | BewoningMetPeildatum |
    | peildatum                        | gisteren             |
    | adresseerbaarObjectIdentificatie | 0800010000713450     |
    | header: Accept                   |                      |
    Then the response has 0 occupancies

Rule: The supported content type and charset for the request body are application/json and utf-8 respectively

  @fout-case
  Scenario Outline: '<media type>' has been supplied as the Content-Type value
    When gba occupancy is searched with the following parameters
    | naam                             | waarde               |
    | type                             | BewoningMetPeildatum |
    | peildatum                        | gisteren             |
    | adresseerbaarObjectIdentificatie | 0800010000713450     |
    | header: Content-Type             | <media type>         |
    Then the response has an object with the following data
    | naam     | waarde                                                       |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.13 |
    | title    | Media Type wordt niet ondersteund.                           |
    | detail   | Ondersteunde content type: application/json; charset=utf-8.  |
    | code     | unsupportedMediaType                                         |
    | status   | 415                                                          |
    | instance | /haalcentraal/api/bewoning/bewoningen                        |

    Examples:
    | media type                       |
    | application/xml                  |
    | text/csv                         |
    | application/json; charset=cp1252 |
    | */*                              |
    | */*; charset=utf-8               |
    | */*;charset=utf-8                |

  Scenario Outline: '<media type>' has been supplied as the Content-Type value
    When gba occupancy is searched with the following parameters
    | naam                             | waarde               |
    | type                             | BewoningMetPeildatum |
    | peildatum                        | gisteren             |
    | adresseerbaarObjectIdentificatie | 0800010000713450     |
    | header: Content-Type             | <media type>         |
    Then the response has 0 occupancies

    Examples:
    | media type                      |
    | application/json                |
    | application/json;charset=utf-8  |
    | application/json; charset=utf-8 |
    | application/json;charset=Utf-8  |
    | application/json; charset=UTF-8 |

Rule: The default content type and charset for the request body are application/json and utf-8 respectively

  Scenario: no Content-Type header has been supplied
    When gba occupancy is searched with the following parameters
    | naam                             | waarde               |
    | type                             | BewoningMetPeildatum |
    | peildatum                        | gisteren             |
    | adresseerbaarObjectIdentificatie | 0800010000713450     |
    Then the response has 0 occupancies

  Scenario: a Content-Type header with an empty value has been supplied
    When gba occupancy is searched with the following parameters
    | naam                             | waarde               |
    | type                             | BewoningMetPeildatum |
    | peildatum                        | gisteren             |
    | adresseerbaarObjectIdentificatie | 0800010000713450     |
    | header: Content-Type             |                      |
    Then the response has 0 occupancies

Rule: For privacy and security reasons, a query of occupancies must be made using the POST call

  @fout-case
  Scenario Outline: occupancies are searched with a '<aanroep type>' call
    When gba occupancy is searched with a '<aanroep type>' call
    Then the response has an object with the following data
    | naam     | waarde                                                      |
    | type     | https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.5 |
    | title    | Gebruikte bevragingsmethode is niet toegestaan.             |
    | code     | methodNotAllowed                                            |
    | status   | 405                                                         |
    | instance | /haalcentraal/api/bewoning/bewoningen                       |

    Examples:
    | aanroep type |
    | GET          |
    | PUT          |
    | PATCH        |
    | DELETE       |
  # | CONNECT      | a CONNECT call is not used for querying
  # | HEAD         | a HEAD response contains no body
    | OPTIONS      |
    | TRACE        |