Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit c250b3c

Browse files
author
Derik Evangelista
authored
v3(services): refactor SI job tests (cloudfoundry#1735)
1 parent 053c1f2 commit c250b3c

File tree

8 files changed

+798
-1099
lines changed

8 files changed

+798
-1099
lines changed

app/jobs/v3/delete_service_instance_job.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,9 @@ def operation_type
2727
'delete'
2828
end
2929

30-
private
31-
3230
def gone!
3331
finish
3432
end
35-
36-
def compatibility_checks
37-
nil
38-
end
3933
end
4034
end
4135
end

app/jobs/v3/service_instance_async_job.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ def perform
4141
operation_succeeded
4242
record_event(si, @request_attr)
4343
finish
44-
45-
return
4644
end
4745
rescue => err
4846
fail!(err)
4947
end
5048

51-
if service_instance.last_operation.state == 'failed'
49+
if service_instance.present? && service_instance.last_operation.state == 'failed'
5250
operation_failed!(service_instance.last_operation.description)
5351
end
5452
end

app/jobs/v3/update_service_instance_job.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ def send_broker_request(client)
3232
@update_response
3333
end
3434

35-
private
36-
37-
attr_reader :message
38-
3935
def operation_succeeded
4036
updates = message.updates.tap do |u|
4137
u[:service_plan_guid] = service_plan.guid
@@ -46,10 +42,13 @@ def operation_succeeded
4642
ServiceInstance.db.transaction do
4743
service_instance.update_service_instance(updates)
4844
MetadataUpdate.update(service_instance, message)
49-
record_event(service_instance, message.audit_hash)
5045
end
5146
end
5247

48+
private
49+
50+
attr_reader :message
51+
5352
def service_plan_gone!
5453
raise CloudController::Errors::ApiError.new_from_details('ServicePlanNotFound', service_instance_guid)
5554
end

0 commit comments

Comments
 (0)