Skip to content

Commit

Permalink
Add Description to MaintenanceInfo definition
Browse files Browse the repository at this point in the history
Maintenance Info description should be supported by ODB
[#167808805]
  • Loading branch information
Winna Bridgewater committed Aug 21, 2019
1 parent 68c365c commit 3a8f5a9
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 32 deletions.
7 changes: 4 additions & 3 deletions domain/maintenance_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package domain
import "reflect"

type MaintenanceInfo struct {
Public map[string]string `json:"public,omitempty"`
Private string `json:"private,omitempty"`
Version string `json:"version,omitempty"`
Public map[string]string `json:"public,omitempty"`
Private string `json:"private,omitempty"`
Version string `json:"version,omitempty"`
Description string `json:"description,omitempty"`
}

func (m *MaintenanceInfo) Equals(input MaintenanceInfo) bool {
Expand Down
61 changes: 35 additions & 26 deletions domain/maintenance_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,52 @@ var _ = Describe("MaintenanceInfo", func() {
Entry(
"one extra property is added",
domain.MaintenanceInfo{
Public: map[string]string{"foo": "bar"},
Private: "test",
Public: map[string]string{"foo": "bar"},
Private: "test",
Description: "test",
},
domain.MaintenanceInfo{
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Description: "test",
}),
Entry(
"one property is different",
domain.MaintenanceInfo{
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Description: "test-different",
},
domain.MaintenanceInfo{
Public: map[string]string{"foo": "bar"},
Private: "test-not-the-same",
Version: "1.2.3",
Public: map[string]string{"foo": "bar"},
Private: "test-not-the-same",
Version: "1.2.3",
Description: "test",
}),
Entry(
"all properties are missing in one of the objects",
domain.MaintenanceInfo{
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Description: "test",
},
domain.MaintenanceInfo{}),
Entry(
"all properties are defined but different",
domain.MaintenanceInfo{
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Description: "test",
},
domain.MaintenanceInfo{
Public: map[string]string{"bar": "foo"},
Private: "test-not-the-same",
Version: "8.9.6-rc3",
Public: map[string]string{"bar": "foo"},
Private: "test-not-the-same",
Version: "8.9.6-rc3",
Description: "test-different",
}),
)

Expand All @@ -78,14 +85,16 @@ var _ = Describe("MaintenanceInfo", func() {
Entry(
"all properties are the same",
domain.MaintenanceInfo{
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Description: "test",
},
domain.MaintenanceInfo{
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Public: map[string]string{"foo": "bar"},
Private: "test",
Version: "1.2.3",
Description: "test",
}),
Entry(
"all properties are empty",
Expand Down
8 changes: 5 additions & 3 deletions domain/service_catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ var _ = Describe("ServiceCatalog", func() {
Public: map[string]string{
"name": "foo",
},
Private: "someprivatehashedvalue",
Version: "8.1.0",
Private: "someprivatehashedvalue",
Version: "8.1.0",
Description: "test",
},
}
jsonString := `{
Expand All @@ -127,7 +128,8 @@ var _ = Describe("ServiceCatalog", func() {
"name": "foo"
},
"private": "someprivatehashedvalue",
"version": "8.1.0"
"version": "8.1.0",
"description": "test"
}
}`

Expand Down

0 comments on commit 3a8f5a9

Please sign in to comment.