Skip to content

Commit

Permalink
checkstyle/javaformat
Browse files Browse the repository at this point in the history
  • Loading branch information
user authored and soe78 committed Feb 7, 2021
1 parent 5a8bf8d commit 8e00561
Showing 1 changed file with 31 additions and 15 deletions.
@@ -1,6 +1,20 @@
package de.codecentric.boot.admin.server.config;
/*
* Copyright 2014-2020 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import static org.junit.jupiter.api.Assertions.assertEquals;
package de.codecentric.boot.admin.server.config;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand All @@ -9,24 +23,26 @@
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import static org.assertj.core.api.Assertions.assertThat;

@ExtendWith(SpringExtension.class)
@EnableConfigurationProperties(value = AdminServerProperties.class)
@EnableConfigurationProperties(AdminServerProperties.class)
@TestPropertySource("classpath:server-config-test.properties")
public class AdminServerPropertiesTest {

@Autowired
private AdminServerProperties serverConfig;
@Autowired
private AdminServerProperties serverConfig;

@Test
void testLoadConfigurationProperties() {
assertThat(serverConfig.getContextPath()).isEqualTo("/admin");

@Test
void testLoadConfigurationProperties() {

assertEquals("/admin", serverConfig.getContextPath());
assertThat(serverConfig.getInstanceAuth().getDefaultUserName()).isEqualTo("admin");
assertThat(serverConfig.getInstanceAuth().getDefaultPassword()).isEqualTo("topsecret");

assertEquals("admin", serverConfig.getInstanceAuth().getDefaultUserName());
assertEquals("topsecret", serverConfig.getInstanceAuth().getDefaultPassword());
assertThat(serverConfig.getInstanceAuth().getServiceMap().get("my-service").getUserName()).isEqualTo("me");
assertThat(serverConfig.getInstanceAuth().getServiceMap().get("my-service").getUserPassword())
.isEqualTo("secret");
}

assertEquals("me", serverConfig.getInstanceAuth().getServiceMap().get("my-service").getUserName());
assertEquals("secret", serverConfig.getInstanceAuth().getServiceMap().get("my-service").getUserPassword());
}

}

0 comments on commit 8e00561

Please sign in to comment.