// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/configuration/CommonConfiguration.java
// @Configuration
// public class CommonConfiguration {
// 
// 	@Bean("machine-to-machine-web-client")
// 	public WebClient m2mWebClient(List<MachineToMachineWebClientConfigurer> configurers) {
// 		WebClient.Builder builder = WebClient.builder()
// 				.apply(this::applyWebClientResponseExceptionFilter);
// 		configurers.forEach(builder::apply);
// 		return builder.build();
// 	}
// 
// 	private void applyWebClientResponseExceptionFilter(WebClient.Builder builder) {
// 		builder.filter(ExchangeFilterFunctions.statusError(HttpStatus::isError,
// 				WebClientResponseExceptionCreator::createResponseException));
// 	}
// 
// }


import org.junit.Test;
import be.ordina.msdashboard.configuration.CommonConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository;
import static org.assertj.core.api.Assertions.assertThat;
/*
 * Copyright 2015-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.
 * 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.
 */

package be.ordina.msdashboard.security;





/**
 * @author Tim Ysewyn
 */
public class SecurityConfigurationTests {

	private static final String BASIC_PREFIX = "ms-dashboard.security.basic.client";
	private static final String REGISTRATION_PREFIX = "spring.security.oauth2.client.registration.ms-dashboard";
	private static final String PROVIDER_PREFIX = "spring.security.oauth2.client.provider";

	private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
			.withConfiguration(AutoConfigurations.of(
					SecurityConfiguration.class,
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/configuration/CommonConfiguration.java
// @Configuration
// public class CommonConfiguration {
// 
// 	@Bean("machine-to-machine-web-client")
// 	public WebClient m2mWebClient(List<MachineToMachineWebClientConfigurer> configurers) {
// 		WebClient.Builder builder = WebClient.builder()
// 				.apply(this::applyWebClientResponseExceptionFilter);
// 		configurers.forEach(builder::apply);
// 		return builder.build();
// 	}
// 
// 	private void applyWebClientResponseExceptionFilter(WebClient.Builder builder) {
// 		builder.filter(ExchangeFilterFunctions.statusError(HttpStatus::isError,
// 				WebClientResponseExceptionCreator::createResponseException));
// 	}
// 
// }


// Path: microservices-dashboard-server-core/src/test/java/be/ordina/msdashboard/security/SecurityConfigurationTests.java
import org.junit.Test;
import be.ordina.msdashboard.configuration.CommonConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository;
import static org.assertj.core.api.Assertions.assertThat;

/*
 * Copyright 2015-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.
 * 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.
 */

package be.ordina.msdashboard.security;





/**
 * @author Tim Ysewyn
 */
public class SecurityConfigurationTests {

	private static final String BASIC_PREFIX = "ms-dashboard.security.basic.client";
	private static final String REGISTRATION_PREFIX = "spring.security.oauth2.client.registration.ms-dashboard";
	private static final String PROVIDER_PREFIX = "spring.security.oauth2.client.provider";

	private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
			.withConfiguration(AutoConfigurations.of(
					SecurityConfiguration.class,
					CommonConfiguration.class));