Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»How to send nested JSON in cucumber as request

    How to send nested JSON in cucumber as request

    June 25, 2024

    I’m trying to send nested JSON through Cucumber data table. I have the following scenario, I have tried Scenario Outline too but it didn’t resolve the issue.

    Scenario: provider edits new productWorkingDate
    Given productWorkingDates is edited with following fields
    | id | productId | fromDate | toDate | name | strictHours | maxUsedTicketsQuantity | errorCode |
    | bpvjPBpJ | WaNX2QOd | 2022-07-01 | 2022-12-01 | Test55 | false | 0 | 0 |
    And TimeSlots is edited with following fields
    | dayOfWeek | startTime | endTime | duration | quantity | usedQuantity | active |
    | Sunday | 14:00:00 | 15:00:00 | 02:00:00 | 0 | 0 | true |
    | Monday | 14:00:00 | 15:00:00 | 02:00:00 | 0 | 0 | true |

    Then verify status code is 200

    and I have the following step definition

    @And(“^TimeSlots is edited with following fields$”)
    public void timeslotsIsCreatedWithFollowingFields(List<Map<String, String>> expectedTimeSlots) {
    TimeSlots timeSlots = new TimeSlots();

    for(int i = 0; i < expectedTimeSlots.size(); i ++) {
    timeSlots.setDayOfWeek(expectedTimeSlots.get(i).get(“dayOfWeek”));
    timeSlots.setStartTime(expectedTimeSlots.get(i).get(“startTime”));
    timeSlots.setEndTime((expectedTimeSlots.get(i).get(“endTime”)));
    timeSlots.setDuration(expectedTimeSlots.get(i).get(“duration”));
    timeSlots.setQuantity(Integer.parseInt(expectedTimeSlots.get(i).get(“quantity”)));
    timeSlots.setUsedQuantity(Integer.parseInt(expectedTimeSlots.get(i).get(“usedQuantity”)));
    timeSlots.setActive(Boolean.parseBoolean(expectedTimeSlots.get(i).get(“active”)));

    }

    Actual output is :

    {
    “productWorkingDate”: {
    “id”: “bpvjPBpJ”,
    “productId”: “WaNX2QOd”,
    “fromDate”: “2022-07-01”,
    “toDate”: “2022-12-01”,
    “name”: “Test55”,
    “strictHours”: false,
    “timeSlots”: [
    {
    “id”: “Wlqb8XOb”,
    “productWorkingDateId”: “bpvjPBpJ”,
    “dayOfWeek”: “Monday”,
    “startTime”: “14:00:00”,
    “endTime”: “15:00:00”,
    “duration”: “02:00:00”,
    “quantity”: 0,
    “usedQuantity”: 0,
    “active”: true,
    “deletedAt”: null
    }
    ],
    “deletedAt”: null,
    “maxUsedTicketsQuantity”: 0,
    “errorCode”: 0
    },
    “maxUsedTicketsQuantity”: 0,
    “error”: null,
    “errorCode”: 0
    }

    Expected output is :

    {
    “productWorkingDate”: {
    “id”: “bpvjPBpJ”,
    “productId”: “WaNX2QOd”,
    “fromDate”: “2022-07-01”,
    “toDate”: “2022-12-01”,
    “name”: “Test55”,
    “strictHours”: false,
    “timeSlots”: [
    {
    “id”: “4lrn8old”,
    “productWorkingDateId”: “bpvjPBpJ”,
    “dayOfWeek”: “Sunday”,
    “startTime”: “14:00:00”,
    “endTime”: “15:00:00”,
    “duration”: “02:00:00”,
    “quantity”: 0,
    “usedQuantity”: 0,
    “active”: true,
    “deletedAt”: null
    },
    {
    “id”: “dOnz85OV”,
    “productWorkingDateId”: “bpvjPBpJ”,
    “dayOfWeek”: “Monday”,
    “startTime”: “14:00:00”,
    “endTime”: “15:00:00”,
    “duration”: “02:00:00”,
    “quantity”: 0,
    “usedQuantity”: 0,
    “active”: true,
    “deletedAt”: null
    }
    ],
    “deletedAt”: null,
    “maxUsedTicketsQuantity”: 0,
    “errorCode”: 0
    },
    “maxUsedTicketsQuantity”: 0,
    “error”: null,
    “errorCode”: 0
    }

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleWhy is my jmeter aggregate report showing much more time than actual?
    Next Article AI21 Labs Jamba-Instruct model is now available in Amazon Bedrock

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 17, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-40906 – MongoDB BSON Serialization BSON::XS Multiple Vulnerabilities

    May 17, 2025
    Leave A Reply Cancel Reply

    Hostinger

    Continue Reading

    Accessibility Best Practices for Single Page Applications (SPAs)

    Development

    CVE-2025-37887 – Linux Kernel PDS_CORE Devlink Command Buffer Overflow

    Common Vulnerabilities and Exposures (CVEs)

    Embracing Flexibility: Education Accessibility in the Universal Design Series – 4

    Development

    From Phantoms to Facts: DPO Fine-Tuning Minimizes Hallucinations in Radiology Reports, Boosting Clinical Trust

    Development

    Highlights

    Architecting Innovation: Mastering Clean Architecture and MVVM for iOS Development

    June 17, 2024

    Post Content Source: Read More 

    CVE-2023-53122 – RISC-V SiFive Errata Patching Mutex Vulnerability

    May 2, 2025

    Cybercriminals Exploit Popular Software Searches to Spread FakeBat Malware

    August 19, 2024

    CVE-2025-47815 – GNU PSPP Heap-Based Buffer Overflow Vulnerability

    May 10, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.