You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2019/12/17 09:47:17 UTC
[camel-k] 01/10: Fix #1058: rename hystrix to circuitBreaker
This is an automated email from the ASF dual-hosted git repository.
nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit eb3109e74e51a7f935aea12a54ddc6238e7e62f2
Author: Nicola Ferraro <ni...@gmail.com>
AuthorDate: Mon Dec 16 10:01:24 2019 +0100
Fix #1058: rename hystrix to circuitBreaker
---
pkg/metadata/metadata_dependencies_test.go | 12 ++++++------
pkg/util/source/inspector.go | 2 +-
pkg/util/source/inspector_xml.go | 2 +-
pkg/util/source/inspector_yaml.go | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/pkg/metadata/metadata_dependencies_test.go b/pkg/metadata/metadata_dependencies_test.go
index 9411163..381ce1e 100644
--- a/pkg/metadata/metadata_dependencies_test.go
+++ b/pkg/metadata/metadata_dependencies_test.go
@@ -238,7 +238,7 @@ func TestHystrixDependency(t *testing.T) {
Name: "Request.groovy",
Content: `
from("http:test")
- .hystrix()
+ .circuitBreaker()
.to("log:end")
.onFallback()
.to("log:fallback")
@@ -352,12 +352,12 @@ func TestXMLHystrixDependency(t *testing.T) {
Name: "routes.xml",
Content: `
<from uri="direct:ciao" />
- <hystrix>
+ <circuitBreaker>
<to uri="log:info" />
<onFallback>
<to uri="kafka:topic" />
</onFallback>
- </hystrix>
+ </circuitBreaker>
`,
},
Language: v1alpha1.LanguageXML,
@@ -457,11 +457,11 @@ const yamlWithRest = `
- to: "log:info"
- to: "direct:hello"
`
-const yamlWithHystrix = `
+const yamlWithCircuitBreaker = `
- from:
uri: "direct:start"
steps:
- - hystrix:
+ - circuitBreaker:
todo: "not implemented"
`
@@ -514,7 +514,7 @@ func TestYAMLHystrixDependency(t *testing.T) {
DataSpec: v1alpha1.DataSpec{
Name: "routes.yaml",
- Content: yamlWithHystrix,
+ Content: yamlWithCircuitBreaker,
},
Language: v1alpha1.LanguageYaml,
}
diff --git a/pkg/util/source/inspector.go b/pkg/util/source/inspector.go
index c6ad2d2..01d9d5e 100644
--- a/pkg/util/source/inspector.go
+++ b/pkg/util/source/inspector.go
@@ -44,7 +44,7 @@ var (
main: map[string]string{
`.*JsonLibrary\.Jackson.*`: "camel:jackson",
`.*\.json\(\).*`: "camel:jackson",
- `.*\.hystrix\(\).*`: "camel:hystrix",
+ `.*\.circuitBreaker\(\).*`: "camel:hystrix",
`.*restConfiguration\(\).*`: "camel:rest",
`.*rest\(("[a-zA-Z0-9-/]+")*\).*`: "camel:rest",
`^\s*rest\s*{.*`: "camel:rest",
diff --git a/pkg/util/source/inspector_xml.go b/pkg/util/source/inspector_xml.go
index 116ed62..7dac370 100644
--- a/pkg/util/source/inspector_xml.go
+++ b/pkg/util/source/inspector_xml.go
@@ -45,7 +45,7 @@ func (i XMLInspector) Extract(source v1alpha1.SourceSpec, meta *Metadata) error
switch se.Name.Local {
case "rest", "restConfiguration":
meta.Dependencies.Add("camel:rest")
- case "hystrix":
+ case "circuitBreaker":
meta.Dependencies.Add("camel:hystrix")
case "simple":
meta.Dependencies.Add("camel:bean")
diff --git a/pkg/util/source/inspector_yaml.go b/pkg/util/source/inspector_yaml.go
index 7a16d1a..8abd923 100644
--- a/pkg/util/source/inspector_yaml.go
+++ b/pkg/util/source/inspector_yaml.go
@@ -56,7 +56,7 @@ func (inspector YAMLInspector) parseStep(key string, content interface{}, meta *
switch key {
case "rest":
meta.Dependencies.Add("camel:rest")
- case "hystrix":
+ case "circuitBreaker":
meta.Dependencies.Add("camel:hystrix")
}