Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug: can not save service with different app value (#470)
- Loading branch information
1 parent
b1f50fe
commit 5e647f1
Showing
8 changed files
with
132 additions
and
70 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package registry | ||
|
||
import ( | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestMicroServiceInstance_Equal(t *testing.T) { | ||
ins1 := &MicroServiceInstance{ | ||
InstanceID: "1", | ||
ServiceID: "bill", | ||
} | ||
ins2 := &MicroServiceInstance{ | ||
InstanceID: "1", | ||
ServiceID: "bill", | ||
} | ||
assert.True(t, ins1.Equal(ins2)) | ||
|
||
ins3 := &MicroServiceInstance{ | ||
InstanceID: "1", | ||
ServiceID: "bill", | ||
Metadata: map[string]string{ | ||
"a": "b", | ||
"c": "d", | ||
}, | ||
} | ||
ins4 := &MicroServiceInstance{ | ||
InstanceID: "1", | ||
ServiceID: "bill", | ||
Metadata: map[string]string{ | ||
"a": "b", | ||
"c": "d", | ||
}, | ||
} | ||
assert.True(t, ins3.Equal(ins4)) | ||
|
||
ins5 := &MicroServiceInstance{ | ||
InstanceID: "2", | ||
ServiceID: "bill", | ||
} | ||
assert.False(t, ins5.Equal(ins4)) | ||
|
||
ins6 := &MicroServiceInstance{ | ||
InstanceID: "2", | ||
ServiceID: "text", | ||
} | ||
assert.False(t, ins5.Equal(ins6)) | ||
} |