Skip to content

Commit 729d28f

Browse files
Aditya JoshiAditya Joshi
authored andcommitted
code cleanup
1 parent 5b76265 commit 729d28f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/main/java/io/github/lambdatest/utils/SmartUIUtil.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public BuildResponse build(GitInfo git ,String projectToken, Map<String, String>
9494
throw new IllegalArgumentException(Constants.Errors.USER_AUTH_ERROR);
9595
}
9696
CreateBuildRequest createBuildRequest = new CreateBuildRequest();
97-
Config config = new Config();
9897
if (options != null && options.containsKey("buildName")) {
9998
String buildNameStr = options.get("buildName");
10099

@@ -113,10 +112,8 @@ public BuildResponse build(GitInfo git ,String projectToken, Map<String, String>
113112
if(Objects.nonNull(git)){
114113
createBuildRequest.setGit(git);}
115114
String createBuildJson = gson.toJson(createBuildRequest);
116-
117115
Map<String,String> header = new HashMap<>() ;
118-
header.put("projectToken", projectToken);
119-
116+
header.put(Constants.PROJECT_TOKEN, projectToken);
120117
String createBuildResponse = httpClient.createSmartUIBuild(createBuildJson, header);
121118
BuildResponse buildData = gson.fromJson(createBuildResponse, BuildResponse.class);
122119
if (Objects.isNull(buildData)) {
@@ -128,13 +125,11 @@ public BuildResponse build(GitInfo git ,String projectToken, Map<String, String>
128125
public void stopBuild(String buildId, String projectToken) throws Exception{
129126
try{
130127
Map<String,String> headers = new HashMap<>();
131-
headers.put("projectToken", projectToken);
128+
headers.put(Constants.PROJECT_TOKEN, projectToken);
132129
httpClient.stopBuild(buildId, headers);
133130
}
134131
catch (Exception e){
135132
throw new Exception(Constants.Errors.STOP_BUILD_FAILED +" due to: " + e.getMessage());
136133
}
137134
}
138-
139-
140135
}

0 commit comments

Comments
 (0)