All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nepxion.discovery.plugin.test.automation.context.TestEnvironmentPostProcessor Maven / Gradle / Ivy

package com.nepxion.discovery.plugin.test.automation.context;

/**
 * 

Title: Nepxion Discovery

*

Description: Nepxion Discovery

*

Copyright: Copyright (c) 2017-2050

*

Company: Nepxion

* @author Haojun Ren * @version 1.0 */ import org.apache.commons.lang3.StringUtils; import org.springframework.boot.SpringApplication; import org.springframework.boot.env.EnvironmentPostProcessor; import org.springframework.core.Ordered; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.StandardEnvironment; import com.nepxion.discovery.common.constant.DiscoveryConstant; import com.nepxion.discovery.common.entity.ServiceType; public class TestEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { if (StringUtils.equals(environment.getClass().getName(), StandardEnvironment.class.getName())) { System.setProperty(DiscoveryConstant.SPRING_APPLICATION_TYPE, ServiceType.TEST.toString()); } } @Override public int getOrder() { return Ordered.HIGHEST_PRECEDENCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy