File tree Expand file tree Collapse file tree
src/main/java/com/testsigma/sdk Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import lombok .Data ;
44import lombok .RequiredArgsConstructor ;
5- import org .json .JSONObject ;
5+
6+ import java .util .List ;
7+ import java .util .Optional ;
8+ import java .util .stream .Collectors ;
69
710@ Data
811@ RequiredArgsConstructor
912public class EnvironmentData {
1013
11- private final JSONObject parameters ;
14+ private final List < VariableData > variables ;
1215
1316 public String getParameter (String key ){
14- return parameters .get (key ).toString ();
17+ Optional <VariableData > variableData = variables .stream ().filter (variable -> variable .getKey ().equals (key ))
18+ .collect (Collectors .toList ()).stream ().findFirst ();
19+ return variableData .isPresent () ? variableData .get ().getValue () : "" ;
1520 }
1621
1722}
Original file line number Diff line number Diff line change 1+ package com .testsigma .sdk ;
2+
3+ import lombok .Data ;
4+ import lombok .RequiredArgsConstructor ;
5+
6+ @ Data
7+ @ RequiredArgsConstructor
8+ public class VariableData {
9+ private final String key ;
10+ private final String value ;
11+ }
You can’t perform that action at this time.
0 commit comments