Update formatting of spring-boot-samples
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -49,8 +49,7 @@ public class SamplePropertyValidationApplicationTests {
|
||||
@Test
|
||||
public void bindValidProperties() {
|
||||
this.context.register(SamplePropertyValidationApplication.class);
|
||||
TestPropertyValues.of("sample.host:192.168.0.1", "sample.port:9090")
|
||||
.applyTo(this.context);
|
||||
TestPropertyValues.of("sample.host:192.168.0.1", "sample.port:9090").applyTo(this.context);
|
||||
this.context.refresh();
|
||||
SampleProperties properties = this.context.getBean(SampleProperties.class);
|
||||
assertThat(properties.getHost()).isEqualTo("192.168.0.1");
|
||||
@@ -60,8 +59,7 @@ public class SamplePropertyValidationApplicationTests {
|
||||
@Test
|
||||
public void bindInvalidHost() {
|
||||
this.context.register(SamplePropertyValidationApplication.class);
|
||||
TestPropertyValues.of("sample.host:xxxxxx", "sample.port:9090")
|
||||
.applyTo(this.context);
|
||||
TestPropertyValues.of("sample.host:xxxxxx", "sample.port:9090").applyTo(this.context);
|
||||
this.thrown.expect(BeanCreationException.class);
|
||||
this.thrown.expectMessage("Failed to bind properties under 'sample'");
|
||||
this.context.refresh();
|
||||
@@ -79,8 +77,7 @@ public class SamplePropertyValidationApplicationTests {
|
||||
public void validatorOnlyCalledOnSupportedClass() {
|
||||
this.context.register(SamplePropertyValidationApplication.class);
|
||||
this.context.register(ServerProperties.class); // our validator will not apply
|
||||
TestPropertyValues.of("sample.host:192.168.0.1", "sample.port:9090")
|
||||
.applyTo(this.context);
|
||||
TestPropertyValues.of("sample.host:192.168.0.1", "sample.port:9090").applyTo(this.context);
|
||||
this.context.refresh();
|
||||
SampleProperties properties = this.context.getBean(SampleProperties.class);
|
||||
assertThat(properties.getHost()).isEqualTo("192.168.0.1");
|
||||
|
||||
Reference in New Issue
Block a user