Search in sources :

Example 6 with ServerProperties

use of org.springframework.boot.autoconfigure.web.ServerProperties in project coffeenet-starter by coffeenet.

the class CoffeeNetDiscoveryInstancePropertiesTest method setServerPort.

@Test
public void setServerPort() {
    int port = 9999;
    ServerProperties serverProperties = new ServerProperties();
    serverProperties.setPort(port);
    CoffeeNetDiscoveryInstanceProperties sut = new CoffeeNetDiscoveryInstanceProperties(new InetUtils(new InetUtilsProperties()), serverProperties, new CoffeeNetConfigurationProperties());
    assertThat(sut.getNonSecurePort(), is(port));
}
Also used : InetUtilsProperties(org.springframework.cloud.commons.util.InetUtilsProperties) ServerProperties(org.springframework.boot.autoconfigure.web.ServerProperties) CoffeeNetConfigurationProperties(coffee.synyx.autoconfigure.CoffeeNetConfigurationProperties) InetUtils(org.springframework.cloud.commons.util.InetUtils) Test(org.junit.Test)

Example 7 with ServerProperties

use of org.springframework.boot.autoconfigure.web.ServerProperties in project coffeenet-starter by coffeenet.

the class CoffeeNetDiscoveryInstancePropertiesTest method defaultValues.

@Test
public void defaultValues() {
    InetUtils inetUtils = new InetUtils(new InetUtilsProperties());
    ServerProperties serverProperties = new ServerProperties();
    CoffeeNetConfigurationProperties coffeeNetConfigurationProperties = new CoffeeNetConfigurationProperties();
    CoffeeNetDiscoveryInstanceProperties sut = new CoffeeNetDiscoveryInstanceProperties(inetUtils, serverProperties, coffeeNetConfigurationProperties);
    assertThat(sut.getNonSecurePort(), is(8080));
    assertThat(sut.getHostname(), is("localhost"));
}
Also used : InetUtilsProperties(org.springframework.cloud.commons.util.InetUtilsProperties) ServerProperties(org.springframework.boot.autoconfigure.web.ServerProperties) CoffeeNetConfigurationProperties(coffee.synyx.autoconfigure.CoffeeNetConfigurationProperties) InetUtils(org.springframework.cloud.commons.util.InetUtils) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 ServerProperties (org.springframework.boot.autoconfigure.web.ServerProperties)7 CoffeeNetConfigurationProperties (coffee.synyx.autoconfigure.CoffeeNetConfigurationProperties)6 InetUtils (org.springframework.cloud.commons.util.InetUtils)6 InetUtilsProperties (org.springframework.cloud.commons.util.InetUtilsProperties)6 MockEnvironment (org.springframework.mock.env.MockEnvironment)4