File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
main/java/com/bandwidth/iris/sdk
test/java/com/bandwidth/iris/sdk Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 201
201
<autoReleaseAfterClose >true</autoReleaseAfterClose >
202
202
</configuration >
203
203
</plugin >
204
+ <plugin >
205
+ <groupId >org.apache.maven.plugins</groupId >
206
+ <artifactId >maven-jar-plugin</artifactId >
207
+ <configuration >
208
+ <archive >
209
+ <manifest >
210
+ <addDefaultImplementationEntries >true</addDefaultImplementationEntries >
211
+ <addDefaultSpecificationEntries >true</addDefaultSpecificationEntries >
212
+ </manifest >
213
+ </archive >
214
+ </configuration >
215
+ </plugin >
204
216
</plugins >
205
217
</build >
206
218
Original file line number Diff line number Diff line change 15
15
import org .apache .http .entity .FileEntity ;
16
16
import org .apache .http .entity .StringEntity ;
17
17
import org .apache .http .impl .client .DefaultHttpClient ;
18
+ import org .apache .http .params .HttpParams ;
18
19
import org .apache .http .util .EntityUtils ;
19
20
import java .io .FileOutputStream ;
20
21
26
27
27
28
public class IrisClient {
28
29
30
+ public static final String USER_AGENT = "java-bandwidth-iris-" + IrisClient .class .getPackage ().getSpecificationVersion ();
31
+
29
32
private static final String defaultUri = "https://dashboard.bandwidth.com/api" ;
30
33
private static final String defaultVersion = "v1.0" ;
31
34
private final String baseAccountUrl ;
@@ -162,6 +165,8 @@ public String buildModelUri(String[] tokens) throws URISyntaxException {
162
165
}
163
166
164
167
protected IrisResponse executeRequest (HttpUriRequest request ) throws Exception {
168
+ request .addHeader ("User-Agent" , USER_AGENT );
169
+
165
170
Map <String , String > headers = new HashMap <String , String >();
166
171
IrisResponse irisResponse = new IrisResponse ();
167
172
HttpResponse response = httpClient .execute (request );
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public class EmergencyNotificationTests extends BaseModelTests {
16
16
public void TestCreateRecipients () throws Exception {
17
17
String url = "/v1.0/accounts/accountId/emergencyNotificationRecipients" ;
18
18
stubFor (post (urlMatching (url ))
19
+ .withHeader ("User-Agent" , equalTo (IrisClient .USER_AGENT ))
19
20
.willReturn (aResponse ()
20
21
.withStatus (201 ).withBody (IrisClientTestUtils .emergencyNotificationRecipientsResponse )));
21
22
You can’t perform that action at this time.
0 commit comments