Skip to content

Commit 4febb8e

Browse files
committed
[Tech] fix test, make the test to clean
1 parent 7cd89b8 commit 4febb8e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/test/java/com/github/greengerong/PrerenderConfigTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
package com.github.greengerong;
22

3+
import org.apache.http.impl.client.CloseableHttpClient;
34
import org.junit.Test;
45

56
import java.util.HashMap;
67
import java.util.Map;
78

9+
import static org.hamcrest.core.Is.is;
10+
import static org.hamcrest.core.IsNull.notNullValue;
11+
import static org.junit.Assert.assertThat;
12+
813
public class PrerenderConfigTest {
9-
@Test(expected = NumberFormatException.class)
14+
@Test(expected = Exception.class)
1015
public void should_throw_exception_if_invalid_timeout_value_specified() throws Exception {
1116
//given
1217
Map<String, String> configuration = new HashMap<String, String>();
@@ -23,6 +28,8 @@ public void should_pass_if_correct_timeout_value_specified() throws Exception {
2328
configuration.put("socketTimeout", "1000");
2429
PrerenderConfig config = new PrerenderConfig(configuration);
2530
//when
26-
config.getHttpClient();
31+
final CloseableHttpClient httpClient = config.getHttpClient();
32+
33+
assertThat(httpClient, is(notNullValue()));
2734
}
2835
}

0 commit comments

Comments
 (0)