@ -40,6 +40,7 @@ import com.tencent.polaris.factory.config.consumer.CircuitBreakerConfigImpl;
import com.tencent.polaris.factory.config.consumer.ConsumerConfigImpl ;
import com.tencent.polaris.factory.config.consumer.OutlierDetectionConfigImpl ;
import com.tencent.polaris.factory.config.global.APIConfigImpl ;
import com.tencent.polaris.factory.config.global.ClientReporterConfigImpl ;
import com.tencent.polaris.factory.config.global.GlobalConfigImpl ;
import com.tencent.polaris.factory.config.global.ServerConnectorConfigImpl ;
import com.tencent.polaris.factory.config.global.StatReporterConfigImpl ;
@ -94,9 +95,11 @@ class ConfigurationModifierTest {
GlobalConfigImpl globalConfig = mock ( GlobalConfigImpl . class ) ;
StatReporterConfigImpl statReporter = mock ( StatReporterConfigImpl . class ) ;
ClientReporterConfigImpl clientReporter = mock ( ClientReporterConfigImpl . class ) ;
ServerConnectorConfigImpl serverConnector = mock ( ServerConnectorConfigImpl . class ) ;
APIConfigImpl apiConfig = mock ( APIConfigImpl . class ) ;
when ( globalConfig . getStatReporter ( ) ) . thenReturn ( statReporter ) ;
when ( globalConfig . getClientReporter ( ) ) . thenReturn ( clientReporter ) ;
Mockito . lenient ( ) . when ( globalConfig . getServerConnector ( ) ) . thenReturn ( serverConnector ) ;
Mockito . lenient ( ) . when ( globalConfig . getAPI ( ) ) . thenReturn ( apiConfig ) ;
when ( configuration . getGlobal ( ) ) . thenReturn ( globalConfig ) ;
@ -153,6 +156,7 @@ class ConfigurationModifierTest {
// Assert
verify ( configuration . getGlobal ( ) . getStatReporter ( ) ) . setEnable ( false ) ;
verify ( configuration . getGlobal ( ) . getClientReporter ( ) ) . setEnable ( true ) ;
verify ( configuration . getConsumer ( ) . getOutlierDetection ( ) ) . setWhen ( OutlierDetectionConfig . When . never ) ;
verify ( configuration . getConsumer ( ) . getCircuitBreaker ( ) ) . setEnable ( false ) ;
verify ( configuration . getConfigFile ( ) , never ( ) ) . getServerConnector ( ) ;
@ -176,6 +180,7 @@ class ConfigurationModifierTest {
// Assert
verify ( configuration . getGlobal ( ) . getStatReporter ( ) ) . setEnable ( false ) ;
verify ( configuration . getGlobal ( ) . getClientReporter ( ) ) . setEnable ( true ) ;
verify ( configuration . getConfigFile ( ) , never ( ) ) . getServerConnector ( ) ;
}