@@ -94,7 +94,6 @@ public BuildResponse build(GitInfo git ,String projectToken, Map<String, String>
94
94
throw new IllegalArgumentException (Constants .Errors .USER_AUTH_ERROR );
95
95
}
96
96
CreateBuildRequest createBuildRequest = new CreateBuildRequest ();
97
- Config config = new Config ();
98
97
if (options != null && options .containsKey ("buildName" )) {
99
98
String buildNameStr = options .get ("buildName" );
100
99
@@ -113,10 +112,8 @@ public BuildResponse build(GitInfo git ,String projectToken, Map<String, String>
113
112
if (Objects .nonNull (git )){
114
113
createBuildRequest .setGit (git );}
115
114
String createBuildJson = gson .toJson (createBuildRequest );
116
-
117
115
Map <String ,String > header = new HashMap <>() ;
118
- header .put ("projectToken" , projectToken );
119
-
116
+ header .put (Constants .PROJECT_TOKEN , projectToken );
120
117
String createBuildResponse = httpClient .createSmartUIBuild (createBuildJson , header );
121
118
BuildResponse buildData = gson .fromJson (createBuildResponse , BuildResponse .class );
122
119
if (Objects .isNull (buildData )) {
@@ -128,13 +125,11 @@ public BuildResponse build(GitInfo git ,String projectToken, Map<String, String>
128
125
public void stopBuild (String buildId , String projectToken ) throws Exception {
129
126
try {
130
127
Map <String ,String > headers = new HashMap <>();
131
- headers .put ("projectToken" , projectToken );
128
+ headers .put (Constants . PROJECT_TOKEN , projectToken );
132
129
httpClient .stopBuild (buildId , headers );
133
130
}
134
131
catch (Exception e ){
135
132
throw new Exception (Constants .Errors .STOP_BUILD_FAILED +" due to: " + e .getMessage ());
136
133
}
137
134
}
138
-
139
-
140
135
}
0 commit comments