Skip to content

Commit

Permalink
GOSDK-25: Unmarshaling optional enums in response payloads causes pan…
Browse files Browse the repository at this point in the history
…ic (#83)

* GOSDK-25: Unmarshaling optional enums in response payloads causes panic. Instantiating optional enums in restore payloads before assigning value.

* removing test dependency on core go

* GOSDK-25: Unmarshaling optional enums in response payloads causes panic. Using a constructor to create nullable enums to get around problem of preserving nil when nothing is specified.
  • Loading branch information
RachelTucker authored and rpmoore committed Aug 8, 2019
1 parent 4e22fa1 commit fc0c744
Show file tree
Hide file tree
Showing 4 changed files with 607 additions and 14 deletions.
4 changes: 2 additions & 2 deletions ds3/ds3Client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1916,11 +1916,11 @@ func TestVerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3(t *testing.T)
ds3Testing.AssertStringPtrIsNil(t, "PartiallyVerifiedEndOfTape", tape.PartiallyVerifiedEndOfTape)
ds3Testing.AssertNonNilStringPtr(t, "PartitionId", "dc681797-927a-4eb0-9652-d19d06534e50", tape.PartitionId)
if tape.PreviousState != nil {
t.Fatalf("Expeted previous state to be 'nil' but was '%s'.", tape.PreviousState.String())
t.Fatalf("Expeted previous state to be 'nil' but was '%v'.", tape.PreviousState)
}
ds3Testing.AssertStringPtrIsNil(t, "SerialNumber", tape.SerialNumber)
if tape.State != models.TAPE_STATE_PENDING_INSPECTION {
t.Fatalf("Expected tape state 'TAPE_STATE_PENDING_INSPECTION' but got '%s'.", tape.State.String())
t.Fatalf("Expected tape state 'TAPE_STATE_PENDING_INSPECTION' but got '%v'.", tape.State)
}
ds3Testing.AssertStringPtrIsNil(t, "StorageDomainId", tape.StorageDomainMemberId)
ds3Testing.AssertBool(t, "TakeOwnershipPending", false, tape.TakeOwnershipPending)
Expand Down
Loading

0 comments on commit fc0c744

Please sign in to comment.