Skip to content

Commit

Permalink
declared timeout field immutable
Browse files Browse the repository at this point in the history
Signed-off-by: eric-lee-ltk <lidagang1@huawei.com>
  • Loading branch information
eric-lee-ltk authored and seanyinx committed Oct 30, 2017
1 parent 9555846 commit 8c791fc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@
<version>0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
4 changes: 0 additions & 4 deletions transports/transport-httpclient-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,18 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-standalone</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.seanyinx</groupId>
<artifactId>unit-scaffolding</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
@Configuration
public class HttpClientTransportConfig {

@Value("${saga.request.timeout:30000}")
private int requestTimeout;
private final int requestTimeout;

public HttpClientTransportConfig(@Value("${saga.request.timeout:30000}") int requestTimeout) {
this.requestTimeout = requestTimeout;
}

@Bean
@ConditionalOnMissingBean(RestTransport.class)
Expand Down
3 changes: 0 additions & 3 deletions transports/transport-httpclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,14 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-standalone</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.seanyinx</groupId>
<artifactId>unit-scaffolding</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@EnableKamon
public class HttpClientTransport implements RestTransport {

private int requestTimeout;
private final int requestTimeout;
private static final int DEFAULT_REQUEST_TIMEOUT = 30000;

private static final Map<String, Function<URI, Request>> requestFactories = new HashMap<String, Function<URI, Request>>() {{
Expand Down

0 comments on commit 8c791fc

Please sign in to comment.