formatting

This commit is contained in:
spencergibb
2020-10-09 21:15:41 -04:00
parent 5c1da21dc4
commit 5b3b51f45e
2 changed files with 9 additions and 12 deletions

View File

@@ -378,10 +378,10 @@ public class ConfigClientProperties {
public String toString() {
return "ConfigClientProperties [enabled=" + this.enabled + ", profile=" + this.profile + ", name=" + this.name
+ ", label=" + this.label + ", username=" + this.username + ", password=" + this.password + ", uri="
+ Arrays.toString(this.uri) + ", mediaType=" + this.mediaType + ", discovery=" + this.discovery + ", failFast=" + this.failFast
+ ", token=" + this.token + ", requestConnectTimeout=" + this.requestConnectTimeout
+ ", requestReadTimeout=" + this.requestReadTimeout + ", sendState=" + this.sendState + ", headers="
+ this.headers + "]";
+ Arrays.toString(this.uri) + ", mediaType=" + this.mediaType + ", discovery=" + this.discovery
+ ", failFast=" + this.failFast + ", token=" + this.token + ", requestConnectTimeout="
+ this.requestConnectTimeout + ", requestReadTimeout=" + this.requestReadTimeout + ", sendState="
+ this.sendState + ", headers=" + this.headers + "]";
}
/**

View File

@@ -95,21 +95,18 @@ public class ConfigServicePropertySourceLocatorTests {
mockRequestResponseWithoutLabel(new ResponseEntity<>(body, HttpStatus.OK));
ConfigClientProperties properties = new ConfigClientProperties(this.environment);
properties.setMediaType("application/json");
ConfigServicePropertySourceLocator locator = new ConfigServicePropertySourceLocator(
properties);
ConfigServicePropertySourceLocator locator = new ConfigServicePropertySourceLocator(properties);
locator.setRestTemplate(this.restTemplate);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor
.forClass(HttpEntity.class);
ArgumentCaptor<HttpEntity> argumentCaptor = ArgumentCaptor.forClass(HttpEntity.class);
assertThat(locator.locateCollection(this.environment)).isNotNull();
Mockito.verify(this.restTemplate).exchange(anyString(), any(HttpMethod.class),
argumentCaptor.capture(), any(Class.class), anyString(), anyString());
Mockito.verify(this.restTemplate).exchange(anyString(), any(HttpMethod.class), argumentCaptor.capture(),
any(Class.class), anyString(), anyString());
HttpEntity httpEntity = argumentCaptor.getValue();
assertThat(httpEntity.getHeaders().getAccept())
.containsExactly(MediaType.parseMediaType("application/json"));
assertThat(httpEntity.getHeaders().getAccept()).containsExactly(MediaType.parseMediaType("application/json"));
}
@Test