package processmanager
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestProcessManagerServerSessionRecord(t *testing.T) {
InitProcessManager()
pid := 3301
serverSessionId := "server-session-6890fe60-3b0a-4dca-92d2-77a80619d6ef"
ProcessMgr.Processes = append(ProcessMgr.Processes, NewProcess("/local/app/fake-server.sh",
"", pid))
process := ProcessMgr.GetProcess(pid)
Convey("record test", t, func() {
isStarted := ProcessMgr.IsServerSessionStarted(process, serverSessionId)
So(isStarted, ShouldBeFalse)
ProcessMgr.RecordServerSessionStarted(process, serverSessionId)
isStarted = ProcessMgr.IsServerSessionStarted(process, serverSessionId)
So(isStarted, ShouldBeTrue)
})
}