-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
undeploy_first
parameter to wildfly_deployment
Instead of using `cli.update_deploy`, when setting this parameter to `true`, the deployment is undeployed, before being redeployed.
- Loading branch information
1 parent
d9433d4
commit b9bda18
Showing
5 changed files
with
71 additions
and
12 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
45 changes: 45 additions & 0 deletions
45
spec/unit/puppet/provider/wildfly_deployment/http_api_spec.rb
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,45 @@ | ||
require 'spec_helper' | ||
|
||
provider_class = Puppet::Type.type(:wildfly_deployment).provider(:http_api) | ||
|
||
describe provider_class do | ||
let :resource do | ||
Puppet::Type.type(:wildfly_deployment).new( | ||
:name => 'test.ear', | ||
:source => '/tmp/test.ear', | ||
:operation_headers => {}, | ||
:provider => :http_api) | ||
end | ||
|
||
let :provider do | ||
resource.provider | ||
end | ||
|
||
describe 'content=' do | ||
describe 'undeploy_first' do | ||
context 'by default' do | ||
it 'undeploy_first is false' do | ||
expect(resource[:undeploy_first]).to be(false) | ||
end | ||
it 'calls `update_deploy`' do | ||
expect(provider).not_to receive(:destroy) | ||
expect(provider).not_to receive(:create) | ||
|
||
cli = double | ||
allow(provider).to receive(:cli).and_return(cli) | ||
|
||
expect(provider.cli).to receive(:update_deploy).with('test.ear', '/tmp/test.ear', nil, {}) | ||
provider.content = 'unused' | ||
end | ||
end | ||
context 'when undeploy_first => true' do | ||
it 'calls `destroy` followed by `create`' do | ||
resource[:undeploy_first] = true | ||
expect(provider).to receive(:destroy).ordered | ||
expect(provider).to receive(:create).ordered | ||
provider.content = 'unused' | ||
end | ||
end | ||
end | ||
end | ||
end |