func (cm ConnectionMock) Created() time.Time {
	return cm.created
}
Created mocks the connection interface.
package net
import (
	"errors"
	"net"
	"sync/atomic"
	"time"
	"github.com/libonomy/libonomy-p2p/crypto"
	"github.com/libonomy/libonomy-p2p/p2p/p2pcrypto"
)
type ConnectionMock struct {
	id        string
	remotePub p2pcrypto.PublicKey
	session   NetworkSession
	created time.Time
	Addr net.Addr
	sendDelayMs int
	sendRes     error
	sendCnt     int32
	closed bool
}
func NewConnectionMock(key p2pcrypto.PublicKey) *ConnectionMock {
	return &ConnectionMock{
		id:        crypto.UUIDString(),
		remotePub: key,
		closed:    false,
		created:   time.Now(),
	}
}
func (cm ConnectionMock) ID() string {
	return cm.id
}