|
12 | 12 | */
|
13 | 13 | package com.ibm.cloud.sdk.core.test.util;
|
14 | 14 |
|
15 |
| -import java.util.HashMap; |
16 |
| -import java.util.Map; |
17 |
| - |
| 15 | +import com.google.common.collect.Lists; |
| 16 | +import com.ibm.cloud.sdk.core.util.RequestUtils; |
18 | 17 | import org.junit.Assert;
|
19 | 18 | import org.junit.Test;
|
20 | 19 |
|
21 |
| -import com.google.common.collect.Lists; |
22 |
| -import com.ibm.cloud.sdk.core.util.RequestUtils; |
| 20 | +import java.util.HashMap; |
| 21 | +import java.util.Map; |
23 | 22 |
|
24 |
| -import static com.ibm.cloud.sdk.core.util.RequestUtils.loadCoreVersion; |
| 23 | +import static org.junit.Assert.assertNotNull; |
| 24 | +import static org.junit.Assert.assertTrue; |
25 | 25 |
|
26 | 26 | /**
|
27 | 27 | * The Class RequestUtilsTest.
|
@@ -53,12 +53,12 @@ public void testOmit() {
|
53 | 53 |
|
54 | 54 | Map<String, Object> omitted = RequestUtils.omit(params, "A");
|
55 | 55 |
|
56 |
| - Assert.assertTrue(omitted.keySet().containsAll(Lists.newArrayList("B", "C", "D"))); |
57 |
| - Assert.assertTrue(omitted.values().containsAll(Lists.newArrayList(2, 3, 4))); |
| 56 | + assertTrue(omitted.keySet().containsAll(Lists.newArrayList("B", "C", "D"))); |
| 57 | + assertTrue(omitted.values().containsAll(Lists.newArrayList(2, 3, 4))); |
58 | 58 |
|
59 | 59 | omitted = RequestUtils.omit(params, "F");
|
60 |
| - Assert.assertTrue(omitted.keySet().containsAll(Lists.newArrayList("A", "B", "C", "D"))); |
61 |
| - Assert.assertTrue(omitted.values().containsAll(Lists.newArrayList(1, 2, 3, 4))); |
| 60 | + assertTrue(omitted.keySet().containsAll(Lists.newArrayList("A", "B", "C", "D"))); |
| 61 | + assertTrue(omitted.values().containsAll(Lists.newArrayList(1, 2, 3, 4))); |
62 | 62 | }
|
63 | 63 |
|
64 | 64 | /**
|
@@ -103,9 +103,12 @@ public void testPickWithNulls() {
|
103 | 103 | Assert.assertNull(RequestUtils.pick(null));
|
104 | 104 | }
|
105 | 105 |
|
| 106 | + /** |
| 107 | + * Test user agent. |
| 108 | + */ |
106 | 109 | @Test
|
107 |
| - public void testLoadCoreVersion() { |
108 |
| - String version = RequestUtils.loadCoreVersion(); |
109 |
| - Assert.assertEquals("99-SNAPSHOT", version); |
| 110 | + public void testUserAgent() { |
| 111 | + assertNotNull(RequestUtils.getUserAgent()); |
| 112 | + assertTrue(RequestUtils.getUserAgent().startsWith("ibm-java-sdk-core/99-SNAPSHOT")); |
110 | 113 | }
|
111 | 114 | }
|
0 commit comments