summary refs log blame commit diff stats
path: root/svc/conf_test.go
blob: 5956fa16c9e6437b565ed3821eaeb4b266696d61 (plain) (tree)




















                                                                                          
                    
 
package svc

import (
	"reflect"
	"testing"
)

func Test_initConfig(t *testing.T) {
	t.Run("Testing Configuration Initialization", func(t *testing.T) {

		initConfig()
		confObj.Mu.RLock()
		cnf := reflect.Indirect(reflect.ValueOf(confObj))
		confObj.Mu.RUnlock()

		for i := 0; i < cnf.NumField(); i++ {
			if !cnf.Field(i).IsValid() {
				t.Errorf("Uninitialized value: %v\n", cnf.Field(i).Type())
			}
		}
	})
	testConfig()
}