| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| TitanCondition |
|
| 7.0;7 |
| 1 | package com.ctrip.framework.apollo.common.datasource; | |
| 2 | ||
| 3 | import org.springframework.context.annotation.Condition; | |
| 4 | import org.springframework.context.annotation.ConditionContext; | |
| 5 | import org.springframework.core.type.AnnotatedTypeMetadata; | |
| 6 | ||
| 7 | import com.ctrip.framework.apollo.core.utils.StringUtils; | |
| 8 | ||
| 9 | 0 | public class TitanCondition implements Condition { |
| 10 | ||
| 11 | @Override | |
| 12 | public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { | |
| 13 | 0 | if (!StringUtils.isEmpty(context.getEnvironment().getProperty("fat.titan.url"))) { |
| 14 | 0 | return true; |
| 15 | 0 | } else if (!StringUtils.isEmpty(context.getEnvironment().getProperty("uat.titan.url"))) { |
| 16 | 0 | return true; |
| 17 | 0 | } else if (!StringUtils.isEmpty(context.getEnvironment().getProperty("pro.titan.url"))) { |
| 18 | 0 | return true; |
| 19 | } | |
| 20 | 0 | return false; |
| 21 | } | |
| 22 | ||
| 23 | } |