forked from camunda/camunda-bpm-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(distro/run): Make deployChangedOnly Configurable
Description: The feature allows camunda-run to parameterise the filtering of duplicate resources via a configurable flag. Feature-flag: This commit introduces the new feature flag `camunda.bpm.run.deployment.deploy-changed-only` Default-value: `true` (to be backwards compatible with the previously hardcoded behaviour) Has-refactoring: This commit also refactors the `@CamundaBpmRunConfiguration` and all its dependencies to be simpler and conforming to spring-boot best practices. Has-unit-tests: This commit adds three test cases for covering the enabling | Disabling | Absence of the new property. Related-to: camunda#2652
- Loading branch information
Showing
11 changed files
with
228 additions
and
58 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
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
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
37 changes: 37 additions & 0 deletions
37
...un/core/src/main/java/org/camunda/bpm/run/property/CamundaBpmRunDeploymentProperties.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,37 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information regarding copyright | ||
* ownership. Camunda licenses this file to you under the Apache License, | ||
* Version 2.0; 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.camunda.bpm.run.property; | ||
|
||
public class CamundaBpmRunDeploymentProperties { | ||
|
||
public static final String PREFIX = CamundaBpmRunProperties.PREFIX + ".deployment"; | ||
|
||
protected boolean deployChangedOnly = true; | ||
|
||
public boolean isDeployChangedOnly() { | ||
return deployChangedOnly; | ||
} | ||
|
||
public void setDeployChangedOnly(boolean deployChangedOnly) { | ||
this.deployChangedOnly = deployChangedOnly; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CamundaBpmRunDeploymentProperties[" + "deployChangedOnly=" + deployChangedOnly + ']'; | ||
} | ||
} |
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
38 changes: 38 additions & 0 deletions
38
...e/src/test/java/org/camunda/bpm/run/test/config/deploy/DeployChangedOnlyDisabledTest.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,38 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information regarding copyright | ||
* ownership. Camunda licenses this file to you under the Apache License, | ||
* Version 2.0; 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.camunda.bpm.run.test.config.deploy; | ||
|
||
import org.camunda.bpm.run.CamundaBpmRunProcessEngineConfiguration; | ||
import org.camunda.bpm.run.property.CamundaBpmRunDeploymentProperties; | ||
import org.camunda.bpm.run.test.AbstractRestTest; | ||
import org.junit.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.test.context.TestPropertySource; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@TestPropertySource(properties = { CamundaBpmRunDeploymentProperties.PREFIX + ".deploy-changed-only=false" }) | ||
public class DeployChangedOnlyDisabledTest extends AbstractRestTest { | ||
|
||
@Autowired | ||
private CamundaBpmRunProcessEngineConfiguration engineConfig; | ||
|
||
@Test | ||
public void shouldEnableDeployChangedOnlyOnCamundaRunProperty() { | ||
assertThat(engineConfig.isDeployChangedOnly()).isEqualTo(false); | ||
} | ||
} |
Oops, something went wrong.