func TestDocument()

in FindNotification.go [37:51]


func TestDocument(r *vidispine.VSRequestor, docurl string, expectedUriPtr *string, entityTypePtr *string, notificationTypePtr *string) (bool, error) {
	notificationDoc, serverErr := r.Get(docurl, "application/xml")
	if serverErr != nil {
		return false, serverErr
	}

	parsedNotification, parseErr := xmlquery.Parse(notificationDoc)
	if parseErr != nil {
		return false, parseErr
	}

	urlMatch := CheckUrlPath(expectedUriPtr, parsedNotification)
	notificationTypeMatch := CheckNotificationType(notificationTypePtr, entityTypePtr, parsedNotification)
	return urlMatch && notificationTypeMatch, nil
}