Skip to content

Commit

Permalink
MaintenanceInfo Description should be ignored in comparison
Browse files Browse the repository at this point in the history
The Open Service Broker spec says that only the Version should be used
when comparing MaintenanceInfo.
openservicebrokerapi/servicebroker#665

We retain the off-spec comparisons of Public and Private, but should
follow the spec for Version and Description

[#167808805]
  • Loading branch information
blgm committed Aug 27, 2019
1 parent faf0fa5 commit 2711c5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion domain/maintenance_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ type MaintenanceInfo struct {
}

func (m *MaintenanceInfo) Equals(input MaintenanceInfo) bool {
return reflect.DeepEqual(*m, input)
return m.Version == input.Version &&
m.Private == input.Private &&
reflect.DeepEqual(m.Public, input.Public)
}
8 changes: 4 additions & 4 deletions domain/maintenance_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ var _ = Describe("MaintenanceInfo", func() {
domain.MaintenanceInfo{Version: "1.2.0"},
domain.MaintenanceInfo{Version: "2.2.2"},
),
Entry("description field is different",
domain.MaintenanceInfo{Description: "amazing"},
domain.MaintenanceInfo{Description: "terrible"},
),
Entry(
"all properties are missing in one of the objects",
domain.MaintenanceInfo{
Expand Down Expand Up @@ -92,6 +88,10 @@ var _ = Describe("MaintenanceInfo", func() {
"both struct's are nil",
nil,
nil),
Entry("description field is different",
domain.MaintenanceInfo{Description: "amazing"},
domain.MaintenanceInfo{Description: "terrible"},
),
)
})
})

0 comments on commit 2711c5f

Please sign in to comment.