-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#1280): Improve Camel JBang Kubernetes plugin builder API
- Loading branch information
1 parent
56a054a
commit 760c970
Showing
10 changed files
with
519 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...l/src/main/java/org/citrusframework/camel/actions/CamelKubernetesPluginActionBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright 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 org.citrusframework.camel.actions; | ||
|
||
import org.citrusframework.spi.AbstractReferenceResolverAwareTestActionBuilder; | ||
import org.citrusframework.spi.ReferenceResolver; | ||
import org.citrusframework.util.ObjectHelper; | ||
|
||
public class CamelKubernetesPluginActionBuilder extends AbstractReferenceResolverAwareTestActionBuilder<AbstractCamelJBangAction> { | ||
|
||
/** | ||
* Build and deploy a Camel project to Kubernetes | ||
*/ | ||
public CamelKubernetesRunIntegrationAction.Builder run() { | ||
CamelKubernetesRunIntegrationAction.Builder builder = new CamelKubernetesRunIntegrationAction.Builder(); | ||
this.delegate = builder; | ||
return builder; | ||
} | ||
|
||
/** | ||
* Delete a deployed Camel application using the previous exported Kubernetes manifest. | ||
*/ | ||
public CamelKubernetesDeleteAction.Builder delete() { | ||
CamelKubernetesDeleteAction.Builder builder = new CamelKubernetesDeleteAction.Builder(); | ||
this.delegate = builder; | ||
return builder; | ||
} | ||
|
||
/** | ||
* Verify the Kubernetes pod status and logs of a deployed Camel integration. | ||
*/ | ||
public CamelKubernetesVerifyAction.Builder verify() { | ||
CamelKubernetesVerifyAction.Builder builder = new CamelKubernetesVerifyAction.Builder(); | ||
this.delegate = builder; | ||
return builder; | ||
} | ||
|
||
/** | ||
* Export a Camel project from given Camel integration. | ||
*/ | ||
public CamelKubernetesRunIntegrationAction.Builder export() { | ||
CamelKubernetesRunIntegrationAction.Builder builder = new CamelKubernetesRunIntegrationAction.Builder(); | ||
this.delegate = builder; | ||
return builder; | ||
} | ||
|
||
/** | ||
* Sets the bean reference resolver. | ||
* @param referenceResolver | ||
*/ | ||
public CamelKubernetesPluginActionBuilder withReferenceResolver(ReferenceResolver referenceResolver) { | ||
this.referenceResolver = referenceResolver; | ||
return this; | ||
} | ||
|
||
@Override | ||
public AbstractCamelJBangAction build() { | ||
ObjectHelper.assertNotNull(delegate, "Missing delegate action to build"); | ||
return delegate.build(); | ||
} | ||
|
||
} |
125 changes: 0 additions & 125 deletions
125
...oints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelPluginAction.java
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
...itrus-camel/src/main/java/org/citrusframework/camel/actions/CamelPluginActionBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 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 org.citrusframework.camel.actions; | ||
|
||
import org.citrusframework.spi.AbstractReferenceResolverAwareTestActionBuilder; | ||
import org.citrusframework.spi.ReferenceResolver; | ||
import org.citrusframework.util.ObjectHelper; | ||
|
||
public class CamelPluginActionBuilder extends AbstractReferenceResolverAwareTestActionBuilder<AbstractCamelJBangAction> { | ||
|
||
/** | ||
* Processor calling given Camel route as part of the message processing. | ||
* @return | ||
*/ | ||
public AddCamelPluginAction.Builder add() { | ||
AddCamelPluginAction.Builder builder = new AddCamelPluginAction.Builder(); | ||
this.delegate = builder; | ||
return builder; | ||
} | ||
|
||
/** | ||
* Sets the bean reference resolver. | ||
* @param referenceResolver | ||
*/ | ||
public CamelPluginActionBuilder withReferenceResolver(ReferenceResolver referenceResolver) { | ||
this.referenceResolver = referenceResolver; | ||
return this; | ||
} | ||
|
||
@Override | ||
public AbstractCamelJBangAction build() { | ||
ObjectHelper.assertNotNull(delegate, "Missing delegate action to build"); | ||
return delegate.build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.