package runtimeapi

import (
	"testing"
)

const catalogServingCapabilityQuery = `SELECT i.OrgId, i.AppInstallationId, i.ActiveReleaseDigest, i.CatalogRevision, i.State,
b.OrgId, b.AppInstallationId, b.AppReleaseDigest, b.CapabilityId, b.WorkloadId, b.ServiceReleaseDigest,
b.OwnershipEpoch, b.CompatibilityReceiptDigest
FROM _System_CatalogAppInstallation AS i
LEFT JOIN _System_CatalogHandlerBinding AS b
ON b.AppInstallationId = i.AppInstallationId AND b.CapabilityId = ? AND b.State = 'ACTIVE' AND b.ActiveKey IS NOT NULL
WHERE i.AppInstallationId = ?`

func TestCatalogServingSourceRequiresCatalogReadFacade(t *testing.T) {
	if _, err := CatalogServingSource(nil); err == nil {
		t.Fatal("nil Catalog read facade was accepted")
	}
}
