github.com/jxgolibs/go-oauth2-server@v1.0.1/database/database_test.go (about)

     1  package database_test
     2  
     3  import (
     4  	"errors"
     5  	"testing"
     6  
     7  	"github.com/RichardKnop/go-oauth2-server/config"
     8  	"github.com/RichardKnop/go-oauth2-server/database"
     9  	"github.com/stretchr/testify/assert"
    10  )
    11  
    12  func TestNewDatabaseTypeNotSupported(t *testing.T) {
    13  	cnf := &config.Config{
    14  		Database: config.DatabaseConfig{
    15  			Type: "bogus",
    16  		},
    17  	}
    18  	_, err := database.NewDatabase(cnf)
    19  
    20  	if assert.NotNil(t, err) {
    21  		assert.Equal(t, errors.New("Database type bogus not suppported"), err)
    22  	}
    23  }