Skip to content

Commit 6d98be4

Browse files
committed
Fix compile errors after merge
1 parent c244499 commit 6d98be4

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

spring-cloud-consul-config/src/test/java/org/springframework/cloud/consul/config/ConsulPropertySourcesTests.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020
import java.util.LinkedHashMap;
2121
import java.util.List;
2222

23-
import com.ecwid.consul.v1.ConsulClient;
24-
import com.ecwid.consul.v1.QueryParams;
25-
import com.ecwid.consul.v1.Response;
26-
import com.ecwid.consul.v1.kv.model.GetValue;
2723
import org.apache.commons.logging.LogFactory;
2824
import org.junit.Test;
2925

26+
import org.springframework.cloud.consul.ConsulClient;
27+
import org.springframework.cloud.consul.model.http.kv.GetValue;
28+
import org.springframework.http.HttpHeaders;
29+
import org.springframework.http.HttpStatus;
30+
import org.springframework.http.ResponseEntity;
31+
3032
import static org.assertj.core.api.Assertions.assertThat;
31-
import static org.mockito.ArgumentMatchers.any;
3233
import static org.mockito.ArgumentMatchers.eq;
3334
import static org.mockito.ArgumentMatchers.nullable;
3435
import static org.mockito.Mockito.mock;
@@ -48,8 +49,8 @@ public class ConsulPropertySourcesTests {
4849
@Test
4950
public void createPropertySourceStoresNormalizedContextInIndex() {
5051
ConsulClient consul = mock(ConsulClient.class);
51-
Response<List<GetValue>> response = new Response<>(Collections.emptyList(), 1L, false, 1L);
52-
when(consul.getKVValues(eq("test/"), nullable(String.class), any(QueryParams.class))).thenReturn(response);
52+
ResponseEntity<List<GetValue>> response = new ResponseEntity<List<GetValue>>(HttpStatus.OK);
53+
when(consul.getKVValues(eq("test/"), nullable(String.class))).thenReturn(response);
5354

5455
ConsulConfigProperties properties = new ConsulConfigProperties();
5556
ConsulPropertySources sources = new ConsulPropertySources(properties,
@@ -65,7 +66,10 @@ public void createPropertySourceStoresNormalizedContextInIndex() {
6566
@Test
6667
public void createPropertySourceFilesFormatStoresNormalizedContextInIndex() {
6768
ConsulClient consul = mock(ConsulClient.class);
68-
Response<GetValue> response = new Response<>(null, 1L, false, 1L);
69+
ResponseEntity<List<GetValue>> response = mock(ResponseEntity.class);
70+
when(response.getStatusCode()).thenReturn(HttpStatus.OK);
71+
when(response.getBody()).thenReturn(Collections.emptyList());
72+
when(response.getHeaders()).thenReturn(new HttpHeaders());
6973
when(consul.getKVValue(eq("test.yml"), nullable(String.class))).thenReturn(response);
7074

7175
ConsulConfigProperties properties = new ConsulConfigProperties();

0 commit comments

Comments
 (0)