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-4831 – TOTOLINK HTTP POST Request Handler Buffer Overflow Vulnerability

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    How to avoid making lot of mistakes while testing functionality?

    Development

    Eloquent Cast for HTML Strings in Laravel

    Development

    CVE-2025-4197 – Code-projects Patient Record Management System SQL Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    MIT students’ works redefine human-AI collaboration

    Artificial Intelligence

    Highlights

    Development Release: Linux Mint 22.1 Beta

    December 12, 2024

    The DistroWatch news feed is brought to you by TUXEDO COMPUTERS. The Linux Mint project has published a new development snapshot for Linux Mint 22.1. The upcoming release will feature support through to 2029 and offers a number of improvements to the behind-the-scenes package management utilities. The new beta also introduces easy access to power modes to help the….

    How to Create an App out of a Website

    June 5, 2024

    A Closer Look at the AI Assistant of Oracle Analytics

    May 9, 2025

    Google’s quantum breakthrough is ‘truly remarkable’ – but there’s more to do

    December 30, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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