summary refs log tree commit diff stats
path: root/svc/conf_test.go
blob: 37e64a6ea5db7470f8ac90f41f64c42ebaf85981 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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())
			}
		}
	})
}