Repository: datreeio/datree
Pull request #39 (2021-05-20 14:42:24)

fix: Fix tests


Patch:
diff --git a/bl/evaluation/evaluator.go b/bl/evaluation/evaluator.go
index c295cae..65d7e1d 100644
--- a/bl/evaluation/evaluator.go
+++ b/bl/evaluation/evaluator.go
@@ -55,8 +55,8 @@ func (e *Evaluator) CreateEvaluation(cliId string, cliVersion string, k8sVersion
 	return evaluationId, err
 }
 
-func (e *Evaluator) Evaluate(validFilesPathsChan chan string, invalidFilesPathsChan chan *validation.InvalidFile, evaluationId int) (*EvaluationResults, []*validation.InvalidFile, []*cliClient.FileConfiguration, []*Error, error) {
-	filesConfigurations, invalidFiles, errors := e.extractFilesConfigurations(validFilesPathsChan, invalidFilesPathsChan)
+func (e *Evaluator) Evaluate(validFilesPathsChan chan string, invalidFilesPathsChan chan *validation.InvalidFile, evaluationId int) (*EvaluationResults, []*validation.InvalidFile, []*extractor.FileConfiguration, []*Error, error) {
+	filesConfigurations, invalidFiles, extractionErrors := e.extractFilesConfigurations(validFilesPathsChan, invalidFilesPathsChan)
 
 	invalidFilesPaths := []*string{}
 	for _, file := range invalidFiles {
@@ -72,7 +72,7 @@ func (e *Evaluator) Evaluate(validFilesPathsChan chan string, invalidFilesPathsC
 		})
 
 		if stopEvaluation {
-			return nil, invalidFiles, filesConfigurations, errors, err
+			return nil, invalidFiles, filesConfigurations, extractionErrors, err
 		}
 	}
 
@@ -82,19 +82,19 @@ func (e *Evaluator) Evaluate(validFilesPathsChan chan string, invalidFilesPathsC
 			Files:        filesConfigurations,
 		})
 		if err != nil {
-			return nil, invalidFiles, filesConfigurations, errors, err
+			return nil, invalidFiles, filesConfigurations, extractionErrors, err
 		}
 
 		results := e.formatEvaluationResults(res.Results, len(filesConfigurations))
-		return results, invalidFiles, filesConfigurations, errors, nil
+		return results, invalidFiles, filesConfigurations, extractionErrors, nil
 	}
 
-	return nil, invalidFiles, filesConfigurations, errors, nil
+	return nil, invalidFiles, filesConfigurations, extractionErrors, nil
 }
 
-func (e *Evaluator) extractFilesConfigurations(validFilesPathsChan chan string, invalidFilesPathsChan chan *validation.InvalidFile) ([]*cliClient.FileConfiguration, []*validation.InvalidFile, []*Error) {
+func (e *Evaluator) extractFilesConfigurations(validFilesPathsChan chan string, invalidFilesPathsChan chan *validation.InvalidFile) ([]*extractor.FileConfiguration, []*validation.InvalidFile, []*Error) {
 	invalidFiles := []*validation.InvalidFile{}
-	var files []*cliClient.FileConfiguration
+	var files []*extractor.FileConfiguration
 	var errors []*Error
 
 	readFromValidDone := false
@@ -107,7 +107,7 @@ func (e *Evaluator) extractFilesConfigurations(validFilesPathsChan chan string,
 			} else {
 				file, err := extractor.ExtractConfiguration(path)
 				if file != nil {
-					files = append(files, &cliClient.FileConfiguration{
+					files = append(files, &extractor.FileConfiguration{
 						FileName:       file.FileName,
 						Configurations: file.Configurations,
 					})
diff --git a/pkg/cliClient/cliClient.go b/pkg/cliClient/cliClient.go
index 201c4b9..d656cba 100644
--- a/pkg/cliClient/cliClient.go
+++ b/pkg/cliClient/cliClient.go
@@ -8,14 +8,16 @@ type HTTPClient interface {
 	Request(method string, resourceURI string, body interface{}, headers map[string]string) (httpClient.Response, error)
 }
 type CliClient struct {
-	baseUrl    string
-	httpClient HTTPClient
+	baseUrl       string
+	httpClient    HTTPClient
+	timeoutClient HTTPClient
 }
 
 func NewCliClient(url string) *CliClient {
 	httpClient := httpClient.NewClient(url, nil)
 	return &CliClient{
-		baseUrl:    url,
-		httpClient: httpClient,
+		baseUrl:       url,
+		httpClient:    httpClient,
+		timeoutClient: nil,
 	}
 }
diff --git a/pkg/cliClient/evaluation.go b/pkg/cliClient/evaluation.go
index d4b2b11..d473c57 100644
--- a/pkg/cliClient/evaluation.go
+++ b/pkg/cliClient/evaluation.go
@@ -2,6 +2,7 @@ package cliClient
 
 import (
 	"encoding/json"
+	"github.com/datreeio/datree/pkg/extractor"
 	"net/http"
 )
 
@@ -62,14 +63,9 @@ type EvaluationResponse struct {
 	Status  string              `json:"status"`
 }
 
-type FileConfiguration struct {
-	FileName       string                   `json:"fileName"`
-	Configurations []map[string]interface{} `json:"configurations"`
-}
-
 type EvaluationRequest struct {
-	EvaluationId int                  `json:"evaluationId"`
-	Files        []*FileConfiguration `json:"files"`
+	EvaluationId int                            `json:"evaluationId"`
+	Files        []*extractor.FileConfiguration `json:"files"`
 }
 
 func (c *CliClient) RequestEvaluation(request *EvaluationRequest) (*EvaluationResponse, error) {
diff --git a/pkg/cliClient/messages.go b/pkg/cliClient/messages.go
index 435f68b..c878848 100644
--- a/pkg/cliClient/messages.go
+++ b/pkg/cliClient/messages.go
@@ -17,8 +17,14 @@ type VersionMessage struct {
 func (c *CliClient) GetVersionMessage(cliVersion string, timeout int) (*VersionMessage, error) {
 	_timeout := time.Duration(timeout) * time.Millisecond
 
-	httpClient := httpClient.NewClientTimeout(c.baseUrl, nil, _timeout)
-	res, err := httpClient.Request(http.MethodGet, "/cli/messages/versions/"+cliVersion, nil, nil)
+	var timeoutClient HTTPClient
+	if c.timeoutClient != nil {
+		timeoutClient = c.timeoutClient
+	} else {
+		timeoutClient = httpClient.NewClientTimeout(c.baseUrl, nil, _timeout)
+	}
+
+	res, err := timeoutClient.Request(http.MethodGet, "/cli/messages/versions/"+cliVersion, nil, nil)
 	if err != nil {
 		return nil, err
 	}
diff --git a/pkg/extractor/extractor.go b/pkg/extractor/extractor.go
index b6f1823..8978587 100644
--- a/pkg/extractor/extractor.go
+++ b/pkg/extractor/extractor.go
@@ -12,9 +12,11 @@ type FileReader interface {
 	ReadFileContent(filepath string) (string, error)
 }
 
+type K8sConfiguration map[string]interface{}
+
 type FileConfiguration struct {
-	FileName       string
-	Configurations []map[string]interface{}
+	FileName       string             `json:"fileName"`
+	Configurations []K8sConfiguration `json:"configurations"`
 }
 
 type Error struct {
@@ -40,8 +42,8 @@ func ExtractConfiguration(path string) (*FileConfiguration, *Error) {
 	}
 }
 
-func yamlToK8sConfigurations(content string) (*[]map[string]interface{}, error) {
-	var configurations []map[string]interface{}
+func yamlToK8sConfigurations(content string) (*[]K8sConfiguration, error) {
+	var configurations []K8sConfiguration
 
 	yamlDecoder := yaml.NewDecoder(bytes.NewReader([]byte(content)))
 


Test patch:
diff --git a/bl/evaluation/evaluator_test.go b/bl/evaluation/evaluator_test.go
index 82423a7..1ebb56b 100644
--- a/bl/evaluation/evaluator_test.go
+++ b/bl/evaluation/evaluator_test.go
@@ -1,279 +1,299 @@
 package evaluation
 
-//import (
-//	"path/filepath"
-//	"testing"
-//
-//	"github.com/datreeio/datree/pkg/cliClient"
-//	"github.com/stretchr/testify/assert"
-//	"github.com/stretchr/testify/mock"
-//)
-//
-//type mockCliClient struct {
-//	mock.Mock
-//}
-//
-//func (m *mockCliClient) CreateEvaluation(createEvaluationRequest *cliClient.CreateEvaluationRequest) (int, error) {
-//	args := m.Called(createEvaluationRequest)
-//	return args.Get(0).(int), args.Error(1)
-//}
-//
-//func (m *mockCliClient) RequestEvaluation(evaluationRequest *cliClient.EvaluationRequest) (*cliClient.EvaluationResponse, error) {
-//	args := m.Called(evaluationRequest)
-//	return args.Get(0).(*cliClient.EvaluationResponse), args.Error(1)
-//}
-//
-//func (m *mockCliClient) UpdateEvaluationValidation(request *cliClient.UpdateEvaluationValidationRequest) error {
-//	args := m.Called(request)
-//	return args.Error(0)
-//}
-//
-//func (m *mockCliClient) GetVersionMessage(cliVersion string, timeout int) (*cliClient.VersionMessage, error) {
-//	args := m.Called(cliVersion, timeout)
-//	return args.Get(0).(*cliClient.VersionMessage), args.Error(1)
-//}
-//
-//type cliClientMockTestCase struct {
-//	createEvaluation struct {
-//		evaluationId int
-//		err          error
-//	}
-//	requestEvaluation struct {
-//		response *cliClient.EvaluationResponse
-//		err      error
-//	}
-//	updateEvaluationValidation struct {
-//		err error
-//	}
-//	getVersionMessage struct {
-//		response *cliClient.VersionMessage
-//		err      error
-//	}
-//}
-//type evaluatorMock struct {
-//	cliClient *cliClientMockTestCase
-//}
-//
-//func TestEvaluate(t *testing.T) {
-//	tests := []*evaluateTestCase{}
-//	for _, tt := range tests {
-//		t.Run(tt.name, func(t *testing.T) {
-//			mockedCliClient := &mockCliClient{}
-//
-//			mockedCliClient.On("CreateEvaluation", mock.Anything).Return(tt.mock.cliClient.createEvaluation.evaluationId, tt.mock.cliClient.createEvaluation.err)
-//			mockedCliClient.On("UpdateEvaluationValidation", mock.Anything).Return(nil)
-//
-//			evaluator := &Evaluator{
-//				cliClient: mockedCliClient,
-//				osInfo:    tt.args.osInfo,
-//			}
-//
-//			actualResponse, _, _ := evaluator.Evaluate(tt.args.validFilesChan, tt.args.invalidFilesChan, tt.args.evaluationId)
-//
-//			if tt.expected.isRequestEvaluationCalled {
-//				mockedCliClient.AssertCalled(t, "RequestEvaluation", mock.Anything)
-//				assert.Equal(t, tt.expected.response.Summary, actualResponse.Summary)
-//				assert.Equal(t, tt.expected.response.FileNameRuleMapper, actualResponse.FileNameRuleMapper)
-//			}
-//
-//			if tt.expected.isUpdateEvaluationValidationCalled {
-//				mockedCliClient.AssertCalled(t, "UpdateEvaluationValidation", mock.Anything)
-//			}
-//
-//		})
-//	}
-//}
-//
-//func TestCreateEvaluation(t *testing.T) {
-//	tests := []*evaluateTestCase{
-//		request_evaluation_all_invalid(),
-//		request_evaluation_all_valid(),
-//	}
-//	for _, tt := range tests {
-//		t.Run(tt.name, func(t *testing.T) {
-//			mockedCliClient := &mockCliClient{}
-//
-//			mockedCliClient.On("RequestEvaluation", mock.Anything).Return(tt.mock.cliClient.requestEvaluation.response, tt.mock.cliClient.requestEvaluation.err)
-//			mockedCliClient.On("UpdateEvaluationValidation", mock.Anything).Return(nil)
-//
-//			evaluator := &Evaluator{
-//				cliClient: mockedCliClient,
-//				osInfo:    tt.args.osInfo,
-//			}
-//
-//			actualResponse, _, _ := evaluator.Evaluate(tt.args.validFilesChan, tt.args.invalidFilesChan, tt.args.evaluationId)
-//
-//			if tt.expected.isRequestEvaluationCalled {
-//				mockedCliClient.AssertCalled(t, "RequestEvaluation", mock.Anything)
-//				assert.Equal(t, tt.expected.response.Summary, actualResponse.Summary)
-//				assert.Equal(t, tt.expected.response.FileNameRuleMapper, actualResponse.FileNameRuleMapper)
-//			}
-//
-//			if tt.expected.isUpdateEvaluationValidationCalled {
-//				mockedCliClient.AssertCalled(t, "UpdateEvaluationValidation", mock.Anything)
-//			}
-//
-//		})
-//	}
-//}
-//
-//type evaluateArgs struct {
-//	validFilesChan   <-chan string
-//	invalidFilesChan []*string
-//	evaluationId     int
-//	osInfo           *OSInfo
-//}
-//
-//type evaluateExpected struct {
-//	response                           *EvaluationResults
-//	errors                             []*Error
-//	err                                error
-//	isRequestEvaluationCalled          bool
-//	isCreateEvaluationCalled           bool
-//	isUpdateEvaluationValidationCalled bool
-//	isGetVersionMessageCalled          bool
-//}
-//
-//type evaluateTestCase struct {
-//	name     string
-//	args     *evaluateArgs
-//	mock     *evaluatorMock
-//	expected *evaluateExpected
-//}
-//
-//func request_evaluation_all_valid() *evaluateTestCase {
-//	return &evaluateTestCase{
-//		name: "should request validation without invalid files",
-//		args: &evaluateArgs{
-//			validFilesChan:   newFilesChan(),
-//			invalidFilesChan: []*string{},
-//			evaluationId:     1,
-//			osInfo: &OSInfo{
-//				OS:              "darwin",
-//				PlatformVersion: "1.2.3",
-//				KernelVersion:   "4.5.6",
-//			},
-//		},
-//		mock: &evaluatorMock{
-//			cliClient: &cliClientMockTestCase{
-//				createEvaluation: struct {
-//					evaluationId int
-//					err          error
-//				}{
-//					evaluationId: 1,
-//					err:          nil,
-//				},
-//				requestEvaluation: struct {
-//					response *cliClient.EvaluationResponse
-//					err      error
-//				}{
-//					response: &cliClient.EvaluationResponse{
-//						Results: []*cliClient.EvaluationResult{},
-//					},
-//					err: nil,
-//				},
-//				updateEvaluationValidation: struct{ err error }{
-//					err: nil,
-//				},
-//				getVersionMessage: struct {
-//					response *cliClient.VersionMessage
-//					err      error
-//				}{
-//					response: nil,
-//					err:      nil,
-//				},
-//			},
-//		},
-//		expected: &evaluateExpected{
-//			response: &EvaluationResults{
-//				FileNameRuleMapper: make(map[string]map[int]*Rule),
-//				Summary: struct {
-//					RulesCount       int
-//					TotalFailedRules int
-//					FilesCount       int
-//				}{
-//					RulesCount:       0,
-//					TotalFailedRules: 0,
-//					FilesCount:       1,
-//				},
-//			},
-//			errors:                             []*Error{},
-//			err:                                nil,
-//			isRequestEvaluationCalled:          true,
-//			isUpdateEvaluationValidationCalled: false,
-//		},
-//	}
-//}
-//
-//func request_evaluation_all_invalid() *evaluateTestCase {
-//	invalidPath := "path/path1/service.yaml"
-//	return &evaluateTestCase{
-//		name: "should request validation all files are invalid",
-//		args: &evaluateArgs{
-//			validFilesChan:   newFilesChan(),
-//			invalidFilesChan: []*string{&invalidPath},
-//			evaluationId:     1,
-//			osInfo: &OSInfo{
-//				OS:              "darwin",
-//				PlatformVersion: "1.2.3",
-//				KernelVersion:   "4.5.6",
-//			},
-//		},
-//		mock: &evaluatorMock{
-//			cliClient: &cliClientMockTestCase{
-//				createEvaluation: struct {
-//					evaluationId int
-//					err          error
-//				}{
-//					evaluationId: 1,
-//					err:          nil,
-//				},
-//				requestEvaluation: struct {
-//					response *cliClient.EvaluationResponse
-//					err      error
-//				}{
-//					response: &cliClient.EvaluationResponse{
-//						Results: []*cliClient.EvaluationResult{},
-//					},
-//					err: nil,
-//				},
-//				updateEvaluationValidation: struct{ err error }{
-//					err: nil,
-//				},
-//				getVersionMessage: struct {
-//					response *cliClient.VersionMessage
-//					err      error
-//				}{
-//					response: nil,
-//					err:      nil,
-//				},
-//			},
-//		},
-//		expected: &evaluateExpected{
-//			response: &EvaluationResults{
-//				FileNameRuleMapper: make(map[string]map[int]*Rule),
-//				Summary: struct {
-//					RulesCount       int
-//					TotalFailedRules int
-//					FilesCount       int
-//				}{
-//					RulesCount:       0,
-//					TotalFailedRules: 0,
-//					FilesCount:       1,
-//				},
-//			},
-//			errors:                             []*Error{},
-//			err:                                nil,
-//			isRequestEvaluationCalled:          false,
-//			isUpdateEvaluationValidationCalled: true,
-//		},
-//	}
-//}
-//
-//func newFilesChan() chan string {
-//	files := make(chan string, 1)
-//	p, _ := filepath.Abs("../../internal/fixtures/kube/pass-all.yaml")
-//	files <- p
-//	close(files)
-//	return files
-//}
+import (
+	"github.com/datreeio/datree/bl/validation"
+	"path/filepath"
+	"testing"
+
+	"github.com/datreeio/datree/pkg/cliClient"
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/mock"
+)
+
+type mockCliClient struct {
+	mock.Mock
+}
+
+func (m *mockCliClient) CreateEvaluation(createEvaluationRequest *cliClient.CreateEvaluationRequest) (int, error) {
+	args := m.Called(createEvaluationRequest)
+	return args.Get(0).(int), args.Error(1)
+}
+
+func (m *mockCliClient) RequestEvaluation(evaluationRequest *cliClient.EvaluationRequest) (*cliClient.EvaluationResponse, error) {
+	args := m.Called(evaluationRequest)
+	return args.Get(0).(*cliClient.EvaluationResponse), args.Error(1)
+}
+
+func (m *mockCliClient) UpdateEvaluationValidation(request *cliClient.UpdateEvaluationValidationRequest) error {
+	args := m.Called(request)
+	return args.Error(0)
+}
+
+func (m *mockCliClient) GetVersionMessage(cliVersion string, timeout int) (*cliClient.VersionMessage, error) {
+	args := m.Called(cliVersion, timeout)
+	return args.Get(0).(*cliClient.VersionMessage), args.Error(1)
+}
+
+type cliClientMockTestCase struct {
+	createEvaluation struct {
+		evaluationId int
+		err          error
+	}
+	requestEvaluation struct {
+		response *cliClient.EvaluationResponse
+		err      error
+	}
+	updateEvaluationValidation struct {
+		err error
+	}
+	getVersionMessage struct {
+		response *cliClient.VersionMessage
+		err      error
+	}
+}
+type evaluatorMock struct {
+	cliClient *cliClientMockTestCase
+}
+
+func TestEvaluate(t *testing.T) {
+	// TODO: add actual tests
+	tests := []*evaluateTestCase{}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			mockedCliClient := &mockCliClient{}
+
+			mockedCliClient.On("CreateEvaluation", mock.Anything).Return(tt.mock.cliClient.createEvaluation.evaluationId, tt.mock.cliClient.createEvaluation.err)
+			mockedCliClient.On("UpdateEvaluationValidation", mock.Anything).Return(nil)
+
+			evaluator := &Evaluator{
+				cliClient: mockedCliClient,
+				osInfo:    tt.args.osInfo,
+			}
+
+			results, _, _, _, _ := evaluator.Evaluate(tt.args.validFilesChan, tt.args.invalidFilesChan, tt.args.evaluationId)
+
+			if tt.expected.isRequestEvaluationCalled {
+				mockedCliClient.AssertCalled(t, "RequestEvaluation", mock.Anything)
+				assert.Equal(t, tt.expected.response.Summary, results.Summary)
+				assert.Equal(t, tt.expected.response.FileNameRuleMapper, results.FileNameRuleMapper)
+			}
+
+			if tt.expected.isUpdateEvaluationValidationCalled {
+				mockedCliClient.AssertCalled(t, "UpdateEvaluationValidation", mock.Anything)
+			}
+
+		})
+	}
+}
+
+func TestCreateEvaluation(t *testing.T) {
+	tests := []*evaluateTestCase{
+		request_evaluation_all_invalid(),
+		request_evaluation_all_valid(),
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			mockedCliClient := &mockCliClient{}
+
+			mockedCliClient.On("RequestEvaluation", mock.Anything).Return(tt.mock.cliClient.requestEvaluation.response, tt.mock.cliClient.requestEvaluation.err)
+			mockedCliClient.On("UpdateEvaluationValidation", mock.Anything).Return(nil)
+
+			evaluator := &Evaluator{
+				cliClient: mockedCliClient,
+				osInfo:    tt.args.osInfo,
+			}
+
+			// TODO: define and check the rest of the values
+			results, _, _, _, _ := evaluator.Evaluate(tt.args.validFilesChan, tt.args.invalidFilesChan, tt.args.evaluationId)
+
+			if tt.expected.isRequestEvaluationCalled {
+				mockedCliClient.AssertCalled(t, "RequestEvaluation", mock.Anything)
+				assert.Equal(t, tt.expected.response.Summary, results.Summary)
+				assert.Equal(t, tt.expected.response.FileNameRuleMapper, results.FileNameRuleMapper)
+			}
+
+			if tt.expected.isUpdateEvaluationValidationCalled {
+				mockedCliClient.AssertCalled(t, "UpdateEvaluationValidation", mock.Anything)
+			}
+
+		})
+	}
+}
+
+type evaluateArgs struct {
+	validFilesChan   chan string
+	invalidFilesChan chan *validation.InvalidFile
+	evaluationId     int
+	osInfo           *OSInfo
+}
+
+type evaluateExpected struct {
+	response                           *EvaluationResults
+	errors                             []*Error
+	err                                error
+	isRequestEvaluationCalled          bool
+	isCreateEvaluationCalled           bool
+	isUpdateEvaluationValidationCalled bool
+	isGetVersionMessageCalled          bool
+}
+
+type evaluateTestCase struct {
+	name     string
+	args     *evaluateArgs
+	mock     *evaluatorMock
+	expected *evaluateExpected
+}
+
+func request_evaluation_all_valid() *evaluateTestCase {
+	invalidPath := "path/path1/service.yaml"
+
+	return &evaluateTestCase{
+		name: "should request validation without invalid files",
+		args: &evaluateArgs{
+			validFilesChan:   newFilesChan(),
+			invalidFilesChan: newInvalidFilesChan(invalidPath),
+			evaluationId:     1,
+			osInfo: &OSInfo{
+				OS:              "darwin",
+				PlatformVersion: "1.2.3",
+				KernelVersion:   "4.5.6",
+			},
+		},
+		mock: &evaluatorMock{
+			cliClient: &cliClientMockTestCase{
+				createEvaluation: struct {
+					evaluationId int
+					err          error
+				}{
+					evaluationId: 1,
+					err:          nil,
+				},
+				requestEvaluation: struct {
+					response *cliClient.EvaluationResponse
+					err      error
+				}{
+					response: &cliClient.EvaluationResponse{
+						Results: []*cliClient.EvaluationResult{},
+					},
+					err: nil,
+				},
+				updateEvaluationValidation: struct{ err error }{
+					err: nil,
+				},
+				getVersionMessage: struct {
+					response *cliClient.VersionMessage
+					err      error
+				}{
+					response: nil,
+					err:      nil,
+				},
+			},
+		},
+		expected: &evaluateExpected{
+			response: &EvaluationResults{
+				FileNameRuleMapper: make(map[string]map[int]*Rule),
+				Summary: struct {
+					RulesCount       int
+					TotalFailedRules int
+					FilesCount       int
+					TotalPassedCount int
+				}{
+					RulesCount:       0,
+					TotalFailedRules: 0,
+					FilesCount:       1,
+					TotalPassedCount: 1,
+				},
+			},
+			errors:                             []*Error{},
+			err:                                nil,
+			isRequestEvaluationCalled:          true,
+			isUpdateEvaluationValidationCalled: false,
+		},
+	}
+}
+
+func request_evaluation_all_invalid() *evaluateTestCase {
+	invalidPath := "path/path1/service.yaml"
+	return &evaluateTestCase{
+		name: "should request validation all files are invalid",
+		args: &evaluateArgs{
+			validFilesChan:   newFilesChan(),
+			invalidFilesChan: newInvalidFilesChan(invalidPath),
+			evaluationId:     1,
+			osInfo: &OSInfo{
+				OS:              "darwin",
+				PlatformVersion: "1.2.3",
+				KernelVersion:   "4.5.6",
+			},
+		},
+		mock: &evaluatorMock{
+			cliClient: &cliClientMockTestCase{
+				createEvaluation: struct {
+					evaluationId int
+					err          error
+				}{
+					evaluationId: 1,
+					err:          nil,
+				},
+				requestEvaluation: struct {
+					response *cliClient.EvaluationResponse
+					err      error
+				}{
+					response: &cliClient.EvaluationResponse{
+						Results: []*cliClient.EvaluationResult{},
+					},
+					err: nil,
+				},
+				updateEvaluationValidation: struct{ err error }{
+					err: nil,
+				},
+				getVersionMessage: struct {
+					response *cliClient.VersionMessage
+					err      error
+				}{
+					response: nil,
+					err:      nil,
+				},
+			},
+		},
+		expected: &evaluateExpected{
+			response: &EvaluationResults{
+				FileNameRuleMapper: make(map[string]map[int]*Rule),
+				Summary: struct {
+					RulesCount       int
+					TotalFailedRules int
+					FilesCount       int
+					TotalPassedCount int
+				}{
+					RulesCount:       0,
+					TotalFailedRules: 0,
+					FilesCount:       1,
+					TotalPassedCount: 1,
+				},
+			},
+			errors:                             []*Error{},
+			err:                                nil,
+			isRequestEvaluationCalled:          false,
+			isUpdateEvaluationValidationCalled: true,
+		},
+	}
+}
+
+func newFilesChan() chan string {
+	files := make(chan string, 1)
+	p, _ := filepath.Abs("../../internal/fixtures/kube/pass-all.yaml")
+	files <- p
+	close(files)
+	return files
+}
+
+func newInvalidFilesChan(invalidPath string) chan *validation.InvalidFile {
+	invalidFilesChan := make(chan *validation.InvalidFile, 1)
+
+	invalidFilesChan <- &validation.InvalidFile{
+		Path:             invalidPath,
+		ValidationErrors: []error{},
+	}
+	close(invalidFilesChan)
+	return invalidFilesChan
+}
diff --git a/bl/evaluation/printer_test.go b/bl/evaluation/printer_test.go
index e0fffc4..6444106 100644
--- a/bl/evaluation/printer_test.go
+++ b/bl/evaluation/printer_test.go
@@ -1,60 +1,64 @@
 package evaluation
-//
-//import (
-//	"os"
-//	"testing"
-//
-//	"github.com/datreeio/datree/pkg/printer"
-//	"github.com/stretchr/testify/mock"
-//)
-//
-//type mockPrinter struct {
-//	mock.Mock
-//}
-//
-//func (m *mockPrinter) PrintWarnings(warnings []printer.Warning) {
-//	m.Called(warnings)
-//}
-//
-//func (c *mockPrinter) PrintSummaryTable(summary printer.Summary) {
-//	c.Called(summary)
-//}
-//
-//type printResultsTestCaseArgs struct {
-//	results      *EvaluationResults
-//	loginURL     string
-//	outputFormat string
-//	printer      Printer
-//}
-//
-//type printResultsTestCase struct {
-//	name     string
-//	args     *printResultsTestCaseArgs
-//	expected error
-//}
-//
-//func TestPrintResults(t *testing.T) {
-//	tests := []*printResultsTestCase{}
-//	for _, tt := range tests {
-//		mockedPrinter := &mockPrinter{}
-//		mockedPrinter.On("PrintWarnings", mock.Anything)
-//		mockedPrinter.On("PrintSummaryTable", mock.Anything)
-//		t.Run(tt.name, func(t *testing.T) {
-//			PrintResults(tt.args.results, tt.args.loginURL, tt.args.outputFormat, tt.args.printer)
-//
-//			if tt.args.outputFormat == "json" {
-//				mockedPrinter.AssertNotCalled(t, "PrintWarnings")
-//				mockedPrinter.AssertCalled(t, "PrintSummaryTable")
-//			} else if tt.args.outputFormat == "yaml" {
-//				mockedPrinter.AssertNotCalled(t, "PrintWarnings")
-//				mockedPrinter.AssertCalled(t, "PrintSummaryTable")
-//
-//			} else {
-//				pwd, _ := os.Getwd()
-//				warnings, _ := parseToPrinterWarnings(tt.args.results, pwd)
-//				mockedPrinter.AssertCalled(t, "PrintWarnings", warnings)
-//				mockedPrinter.AssertCalled(t, "PrintSummaryTable", tt.args.results, tt.args.loginURL)
-//			}
-//		})
-//	}
-//}
+
+import (
+	"github.com/datreeio/datree/bl/validation"
+	"os"
+	"testing"
+
+	"github.com/datreeio/datree/pkg/printer"
+	"github.com/stretchr/testify/mock"
+)
+
+type mockPrinter struct {
+	mock.Mock
+}
+
+func (m *mockPrinter) PrintWarnings(warnings []printer.Warning) {
+	m.Called(warnings)
+}
+
+func (c *mockPrinter) PrintSummaryTable(summary printer.Summary) {
+	c.Called(summary)
+}
+
+type printResultsTestCaseArgs struct {
+	results           *EvaluationResults
+	invalidFiles      []*validation.InvalidFile
+	evaluationSummary printer.EvaluationSummary
+	loginURL          string
+	outputFormat      string
+	printer           Printer
+}
+
+type printResultsTestCase struct {
+	name     string
+	args     *printResultsTestCaseArgs
+	expected error
+}
+
+// TODO: write actual tests, what is this even?
+func TestPrintResults(t *testing.T) {
+	tests := []*printResultsTestCase{}
+	for _, tt := range tests {
+		mockedPrinter := &mockPrinter{}
+		mockedPrinter.On("PrintWarnings", mock.Anything)
+		mockedPrinter.On("PrintSummaryTable", mock.Anything)
+		t.Run(tt.name, func(t *testing.T) {
+			PrintResults(tt.args.results, tt.args.invalidFiles, tt.args.evaluationSummary, tt.args.loginURL, tt.args.outputFormat, tt.args.printer)
+
+			if tt.args.outputFormat == "json" {
+				mockedPrinter.AssertNotCalled(t, "PrintWarnings")
+				mockedPrinter.AssertCalled(t, "PrintSummaryTable")
+			} else if tt.args.outputFormat == "yaml" {
+				mockedPrinter.AssertNotCalled(t, "PrintWarnings")
+				mockedPrinter.AssertCalled(t, "PrintSummaryTable")
+
+			} else {
+				pwd, _ := os.Getwd()
+				warnings, _ := parseToPrinterWarnings(tt.args.results, tt.args.invalidFiles, pwd)
+				mockedPrinter.AssertCalled(t, "PrintWarnings", warnings)
+				mockedPrinter.AssertCalled(t, "PrintSummaryTable", tt.args.results, tt.args.loginURL)
+			}
+		})
+	}
+}
diff --git a/bl/files/files_test.go b/bl/files/files_test.go
index 16d5096..665920b 100644
--- a/bl/files/files_test.go
+++ b/bl/files/files_test.go
@@ -1,84 +1,75 @@
 package files
-//
-//import (
-//	"fmt"
-//	"path/filepath"
-//	"testing"
-//
-//	"github.com/stretchr/testify/assert"
-//)
-//
-//type toAbsolutePathsTestCase struct {
-//	name string
-//	args struct {
-//		paths []string
-//	}
-//	expected struct {
-//		path string
-//		err  error
-//	}
-//}
-//
-//func TestToAbsolutePaths(t *testing.T) {
-//	tests := []*toAbsolutePathsTestCase{
-//		test_existed_file(),
-//		test_directory_file(),
-//		test_not_existed_file(),
-//	}
-//	for _, tt := range tests {
-//		t.Run(tt.name, func(t *testing.T) {
-//			pathsChan, errors := ToAbsolutePaths(tt.args.paths)
-//			assert.Equal(t, tt.expected.path, <-pathsChan)
-//			assert.Equal(t, tt.expected.err, <-errors)
-//		})
-//	}
-//
-//}
-//
-//func test_existed_file() *toAbsolutePathsTestCase {
-//	p, _ := filepath.Abs("../../internal/fixtures/kube/pass-all.yaml")
-//	return &toAbsolutePathsTestCase{
-//		name: "existed file, should return abs path with no errors",
-//		args: struct{ paths []string }{
-//			paths: []string{"../../internal/fixtures/kube/pass-all.yaml"},
-//		},
-//		expected: struct {
-//			path string
-//			err  error
-//		}{
-//			path: p,
-//			err:  nil,
-//		},
-//	}
-//}
-//
-//func test_not_existed_file() *toAbsolutePathsTestCase {
-//	return &toAbsolutePathsTestCase{
-//		name: "test not existed file, should return an error",
-//		args: struct{ paths []string }{
-//			paths: []string{"../../internal/fixtures/kube/bla.yaml"},
-//		},
-//		expected: struct {
-//			path string
-//			err  error
-//		}{
-//			path: "",
-//			err:  fmt.Errorf("failed parsing absolute path ../../internal/fixtures/kube/bla.yaml"),
-//		},
-//	}
-//}
-//
-//func test_directory_file() *toAbsolutePathsTestCase {
-//	return &toAbsolutePathsTestCase{
-//		args: struct{ paths []string }{
-//			paths: []string{"../../internal/fixtures/kube"},
-//		},
-//		expected: struct {
-//			path string
-//			err  error
-//		}{
-//			path: "",
-//			err:  fmt.Errorf("failed parsing absolute path ../../internal/fixtures/kube"),
-//		},
-//	}
-//}
+
+import (
+	"path/filepath"
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+type toAbsolutePathsTestCase struct {
+	name string
+	args struct {
+		paths []string
+	}
+	expected struct {
+		path string
+	}
+}
+
+func TestToAbsolutePaths(t *testing.T) {
+	tests := []*toAbsolutePathsTestCase{
+		test_existed_file(),
+		test_directory_file(),
+		test_not_existed_file(),
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			pathsChan := ToAbsolutePaths(tt.args.paths)
+			assert.Equal(t, tt.expected.path, <-pathsChan)
+		})
+	}
+
+}
+
+func test_existed_file() *toAbsolutePathsTestCase {
+	p, _ := filepath.Abs("../../internal/fixtures/kube/pass-all.yaml")
+	return &toAbsolutePathsTestCase{
+		name: "existed file, should return abs path with no errors",
+		args: struct{ paths []string }{
+			paths: []string{"../../internal/fixtures/kube/pass-all.yaml"},
+		},
+		expected: struct {
+			path string
+		}{
+			path: p,
+		},
+	}
+}
+
+func test_not_existed_file() *toAbsolutePathsTestCase {
+	return &toAbsolutePathsTestCase{
+		name: "test not existed file, should return an error",
+		args: struct{ paths []string }{
+			paths: []string{"../../internal/fixtures/kube/bla.yaml"},
+		},
+		expected: struct {
+			path string
+		}{
+			path: "",
+		},
+	}
+}
+
+func test_directory_file() *toAbsolutePathsTestCase {
+	return &toAbsolutePathsTestCase{
+		args: struct{ paths []string }{
+			paths: []string{"../../internal/fixtures/kube"},
+		},
+		expected: struct {
+			path string
+		}{
+			path: "",
+		},
+	}
+}
diff --git a/cmd/test/main.go b/cmd/test/main.go
index d8f8f30..cb66337 100644
--- a/cmd/test/main.go
+++ b/cmd/test/main.go
@@ -2,11 +2,9 @@ package test
 
 import (
 	"fmt"
+	"github.com/datreeio/datree/pkg/extractor"
 	"time"
 
-	"github.com/datreeio/datree/pkg/cliClient"
-	"github.com/datreeio/datree/pkg/fileReader"
-
 	"github.com/briandowns/spinner"
 	"github.com/datreeio/datree/bl/evaluation"
 	"github.com/datreeio/datree/bl/messager"
@@ -17,7 +15,7 @@ import (
 )
 
 type Evaluator interface {
-	Evaluate(validFilesPathsChan chan string, invalidFilesPaths chan *validation.InvalidFile, evaluationId int) (*evaluation.EvaluationResults, []*validation.InvalidFile, []*cliClient.FileConfiguration, []*evaluation.Error, error)
+	Evaluate(validFilesPathsChan chan string, invalidFilesPaths chan *validation.InvalidFile, evaluationId int) (*evaluation.EvaluationResults, []*validation.InvalidFile, []*extractor.FileConfiguration, []*evaluation.Error, error)
 	CreateEvaluation(cliId string, cliVersion string, k8sVersion string) (int, error)
 }
 
@@ -40,6 +38,11 @@ type EvaluationPrinter interface {
 	PrintMessage(messageText string, messageColor string)
 	PrintEvaluationSummary(evaluationSummary printer.EvaluationSummary)
 }
+
+type Reader interface {
+	FilterFiles(paths []string) []string
+}
+
 type TestCommandContext struct {
 	CliVersion   string
 	LocalConfig  *localConfig.LocalConfiguration
@@ -47,7 +50,7 @@ type TestCommandContext struct {
 	Messager     Messager
 	K8sValidator K8sValidator
 	Printer      EvaluationPrinter
-	Reader       *fileReader.FileReader
+	Reader       Reader
 }
 
 func New(ctx *TestCommandContext) *cobra.Command {
@@ -101,14 +104,14 @@ func test(ctx *TestCommandContext, paths []string, flags TestCommandFlags) error
 		return err
 	}
 
-	validFilesPaths, invalidFilesPathsChan, errorsChan := ctx.K8sValidator.ValidateResources(filePaths)
+	validFilesPathsChan, invalidFilesPathsChan, errorsChan := ctx.K8sValidator.ValidateResources(paths)
 	go func() {
 		for err := range errorsChan {
 			fmt.Println(err)
 		}
 	}()
 
-	results, invalidFiles, filesConfigurations, errors, err := ctx.Evaluator.Evaluate(validFilesPaths, invalidFilesPathsChan, evaluationId)
+	results, invalidFiles, filesConfigurations, errors, err := ctx.Evaluator.Evaluate(validFilesPathsChan, invalidFilesPathsChan, evaluationId)
 
 	spinner.Stop()
 
diff --git a/cmd/test/main_test.go b/cmd/test/main_test.go
index b54bfcc..dfe9b69 100644
--- a/cmd/test/main_test.go
+++ b/cmd/test/main_test.go
@@ -1,114 +1,194 @@
 package test
 
-//import (
-//	"testing"
-//
-//	"github.com/datreeio/datree/bl/evaluation"
-//	"github.com/datreeio/datree/bl/messager"
-//	"github.com/datreeio/datree/pkg/cliClient"
-//	"github.com/datreeio/datree/pkg/localConfig"
-//	"github.com/stretchr/testify/mock"
-//)
-//
-//type mockLocalConfigManager struct {
-//	mock.Mock
-//}
-//
-//func (m *mockLocalConfigManager) GetConfiguration() (localConfig.LocalConfiguration, error) {
-//	args := m.Called()
-//	return args.Get(0).(localConfig.LocalConfiguration), args.Error(1)
-//}
-//
-//type mockEvaluator struct {
-//	mock.Mock
-//}
-//
-//func (m *mockEvaluator) Evaluate(validFilesPathsChan chan string, invalidFilesPaths []*string, evaluationId int) (*evaluation.EvaluationResults, []*evaluation.Error, error) {
-//	args := m.Called(validFilesPathsChan, invalidFilesPaths, evaluationId)
-//	return args.Get(0).(*evaluation.EvaluationResults), args.Get(1).([]*evaluation.Error), args.Error(2)
-//}
-//
-//func (m *mockEvaluator) CreateEvaluation(cliId string, cliVersion string) (int, error) {
-//	args := m.Called(cliId, cliVersion)
-//	return args.Get(0).(int), args.Error(1)
-//}
-//
-//type mockMessager struct {
-//	mock.Mock
-//}
-//
-//func (m *mockMessager) LoadVersionMessages(messages chan *messager.VersionMessage, cliVersion string) {
-//	m.Called(messages, cliVersion)
-//}
-//
-//func (m *mockMessager) HandleVersionMessage(messageChannel <-chan *messager.VersionMessage) {
-//	m.Called(messageChannel)
-//}
-//func TestTestCommand(t *testing.T) {
-//	mockedEvaluator := &mockEvaluator{}
-//
-//	mockedEvaluateResponse := &evaluation.EvaluationResults{
-//		FileNameRuleMapper: map[string]map[int]*evaluation.Rule{}, Summary: struct {
-//			RulesCount       int
-//			TotalFailedRules int
-//			FilesCount       int
-//		}{RulesCount: 1, TotalFailedRules: 0, FilesCount: 0},
-//	}
-//
-//	mockedEvaluator.On("Evaluate", mock.Anything, mock.Anything, mock.Anything).Return(mockedEvaluateResponse)
-//	mockedEvaluator.On("CreateEvaluation", mock.Anything, mock.Anything).Return(mockedEvaluateResponse)
-//
-//	localConfigManager := &mockLocalConfigManager{}
-//	localConfigManager.On("GetConfiguration").Return(localConfig.LocalConfiguration{CliId: "134kh"}, nil)
-//
-//	messager := &mockMessager{}
-//	messager.On("LoadVersionMessages", mock.Anything).Return(mockedMessagesChannel())
-//
-//	ctx := &TestCommandContext{
-//		Evaluator:   mockedEvaluator,
-//		LocalConfig: &localConfig.LocalConfiguration{},
-//		Messager:    messager,
-//	}
-//
-//	test_testCommand_no_flags(t, localConfigManager, mockedEvaluator, mockedEvaluateResponse, ctx)
-//	test_testCommand_json_output(t, localConfigManager, mockedEvaluator, mockedEvaluateResponse, ctx)
-//	test_testCommand_yaml_output(t, localConfigManager, mockedEvaluator, mockedEvaluateResponse, ctx)
-//}
-//
-//func test_testCommand_no_flags(t *testing.T, localConfigManager *mockLocalConfigManager, evaluator *mockEvaluator, mockedEvaluateResponse *evaluation.EvaluationResults, ctx *TestCommandContext) {
-//	test(ctx, []string{"8/*"}, TestCommandFlags{})
-//	localConfigManager.AssertCalled(t, "GetConfiguration")
-//
-//	evaluator.AssertCalled(t, "Evaluate", []string{"8/*"}, "134kh", 50)
-//	evaluator.AssertNotCalled(t, "PrintFileParsingErrors")
-//	evaluator.AssertCalled(t, "PrintResults", mockedEvaluateResponse, "134kh", "")
-//}
-//
-//func test_testCommand_json_output(t *testing.T, localConfigManager *mockLocalConfigManager, evaluator *mockEvaluator, mockedEvaluateResponse *evaluation.EvaluationResults, ctx *TestCommandContext) {
-//	test(ctx, []string{"8/*"}, TestCommandFlags{Output: "json"})
-//	localConfigManager.AssertCalled(t, "GetConfiguration")
-//
-//	evaluator.AssertCalled(t, "Evaluate", []string{"8/*"}, "134kh", 50)
-//	evaluator.AssertNotCalled(t, "PrintFileParsingErrors")
-//	evaluator.AssertCalled(t, "PrintResults", mockedEvaluateResponse, "134kh", "json")
-//}
-//
-//func test_testCommand_yaml_output(t *testing.T, localConfigManager *mockLocalConfigManager, evaluator *mockEvaluator, mockedEvaluateResponse *evaluation.EvaluationResults, ctx *TestCommandContext) {
-//	test(ctx, []string{"8/*"}, TestCommandFlags{Output: "yaml"})
-//	localConfigManager.AssertCalled(t, "GetConfiguration")
-//
-//	evaluator.AssertCalled(t, "Evaluate", []string{"8/*"}, "134kh", 50)
-//	evaluator.AssertNotCalled(t, "PrintFileParsingErrors")
-//	evaluator.AssertCalled(t, "PrintResults", mockedEvaluateResponse, "134kh", "yaml")
-//}
-//
-//func mockedMessagesChannel() <-chan *cliClient.VersionMessage {
-//	mock := make(chan *cliClient.VersionMessage)
-//	mock <- &cliClient.VersionMessage{
-//		CliVersion:   "1.2.3",
-//		MessageText:  "version message mock",
-//		MessageColor: "green"}
-//	close(mock)
-//
-//	return mock
-//}
+import (
+	"github.com/datreeio/datree/bl/validation"
+	"github.com/datreeio/datree/pkg/extractor"
+	"github.com/datreeio/datree/pkg/printer"
+	"testing"
+
+	"github.com/datreeio/datree/bl/evaluation"
+	"github.com/datreeio/datree/bl/messager"
+	"github.com/datreeio/datree/pkg/localConfig"
+	"github.com/stretchr/testify/mock"
+)
+
+type mockEvaluator struct {
+	mock.Mock
+}
+
+func (m *mockEvaluator) Evaluate(validFilesPathsChan chan string, invalidFilesPaths chan *validation.InvalidFile, evaluationId int) (*evaluation.EvaluationResults, []*validation.InvalidFile, []*extractor.FileConfiguration, []*evaluation.Error, error) {
+	args := m.Called(validFilesPathsChan, invalidFilesPaths, evaluationId)
+	return args.Get(0).(*evaluation.EvaluationResults), args.Get(1).([]*validation.InvalidFile), args.Get(2).([]*extractor.FileConfiguration), args.Get(3).([]*evaluation.Error), args.Error(4)
+}
+
+func (m *mockEvaluator) CreateEvaluation(cliId string, cliVersion string, k8sVersion string) (int, error) {
+	args := m.Called(cliId, cliVersion, k8sVersion)
+	return args.Get(0).(int), args.Error(1)
+}
+
+type mockMessager struct {
+	mock.Mock
+}
+
+func (m *mockMessager) LoadVersionMessages(messages chan *messager.VersionMessage, cliVersion string) {
+	go func() {
+		messages <- &messager.VersionMessage{
+			CliVersion:   "1.2.3",
+			MessageText:  "version message mock",
+			MessageColor: "green"}
+		close(messages)
+	}()
+
+	m.Called(messages, cliVersion)
+}
+
+func (m *mockMessager) HandleVersionMessage(messageChannel <-chan *messager.VersionMessage) {
+	m.Called(messageChannel)
+}
+
+type K8sValidatorMock struct {
+	mock.Mock
+}
+
+func (kv *K8sValidatorMock) ValidateResources(paths []string) (chan string, chan *validation.InvalidFile, chan error) {
+	args := kv.Called(paths)
+	return args.Get(0).(chan string), args.Get(1).(chan *validation.InvalidFile), args.Get(2).(chan error)
+}
+
+type PrinterMock struct {
+	mock.Mock
+}
+
+func (p *PrinterMock) PrintWarnings(warnings []printer.Warning) {
+	p.Called(warnings)
+}
+
+func (p *PrinterMock) PrintSummaryTable(summary printer.Summary) {
+	p.Called(summary)
+}
+
+func (p *PrinterMock) PrintMessage(messageText string, messageColor string) {
+	p.Called(messageText, messageColor)
+}
+
+func (p *PrinterMock) PrintEvaluationSummary(evaluationSummary printer.EvaluationSummary) {
+	p.Called(evaluationSummary)
+}
+
+type ReaderMock struct {
+	mock.Mock
+}
+
+func (rm *ReaderMock) FilterFiles(paths []string) []string {
+	args := rm.Called(paths)
+	return args.Get(0).([]string)
+}
+
+func TestTestCommand(t *testing.T) {
+	evaluationId := 444
+
+	evaluationResults := &evaluation.EvaluationResults{
+		FileNameRuleMapper: map[string]map[int]*evaluation.Rule{}, Summary: struct {
+			RulesCount       int
+			TotalFailedRules int
+			FilesCount       int
+			TotalPassedCount int
+		}{RulesCount: 1, TotalFailedRules: 0, FilesCount: 0, TotalPassedCount: 1},
+	}
+
+	invalidFiles := []*validation.InvalidFile{}
+	var fileConfigurations []*extractor.FileConfiguration
+	var evaluationErrors []*evaluation.Error
+
+	mockedEvaluator := &mockEvaluator{}
+	mockedEvaluator.On("Evaluate", mock.Anything, mock.Anything, mock.Anything).Return(evaluationResults, invalidFiles, fileConfigurations, evaluationErrors, nil)
+	mockedEvaluator.On("CreateEvaluation", mock.Anything, mock.Anything, mock.Anything).Return(evaluationId, nil)
+
+	messager := &mockMessager{}
+	messager.On("LoadVersionMessages", mock.Anything, mock.Anything)
+
+	k8sValidatorMock := &K8sValidatorMock{}
+
+	validFilesPathChan := newValidFilesPathsChan()
+	invalidFilesChan := newInvalidFilesChan()
+
+	k8sValidatorMock.On("ValidateResources", mock.Anything).Return(validFilesPathChan, invalidFilesChan, newErrorsChan())
+
+	printerMock := &PrinterMock{}
+	printerMock.On("PrintWarnings", mock.Anything)
+	printerMock.On("PrintSummaryTable", mock.Anything)
+	printerMock.On("PrintMessage", mock.Anything, mock.Anything)
+	printerMock.On("PrintEvaluationSummary", mock.Anything)
+
+	readerMock := &ReaderMock{}
+
+	readerMock.On("FilterFiles", mock.Anything).Return([]string{"file/path"})
+
+	ctx := &TestCommandContext{
+		K8sValidator: k8sValidatorMock,
+		Evaluator:    mockedEvaluator,
+		LocalConfig:  &localConfig.LocalConfiguration{CliId: "134kh"},
+		Messager:     messager,
+		Printer:      printerMock,
+		Reader:       readerMock,
+	}
+
+	test_testCommand_no_flags(t, mockedEvaluator, validFilesPathChan, invalidFilesChan, evaluationId, ctx)
+	test_testCommand_json_output(t, mockedEvaluator, validFilesPathChan, invalidFilesChan, evaluationId, ctx)
+	test_testCommand_yaml_output(t, mockedEvaluator, validFilesPathChan, invalidFilesChan, evaluationId, ctx)
+}
+
+func test_testCommand_no_flags(t *testing.T, evaluator *mockEvaluator, validFilesPathChan chan string, invalidFilesChan chan *validation.InvalidFile, evaluationId int, ctx *TestCommandContext) {
+	test(ctx, []string{"8/*"}, TestCommandFlags{})
+
+	evaluator.AssertCalled(t, "Evaluate", validFilesPathChan, invalidFilesChan, evaluationId)
+	evaluator.AssertNotCalled(t, "PrintFileParsingErrors")
+}
+
+func test_testCommand_json_output(t *testing.T, evaluator *mockEvaluator, validFilesPathChan chan string, invalidFilesChan chan *validation.InvalidFile, evaluationId int, ctx *TestCommandContext) {
+	test(ctx, []string{"8/*"}, TestCommandFlags{Output: "json"})
+
+	evaluator.AssertCalled(t, "Evaluate", validFilesPathChan, invalidFilesChan, evaluationId)
+	evaluator.AssertNotCalled(t, "PrintFileParsingErrors")
+}
+
+func test_testCommand_yaml_output(t *testing.T, evaluator *mockEvaluator, validFilesPathChan chan string, invalidFilesChan chan *validation.InvalidFile, evaluationId int, ctx *TestCommandContext) {
+	test(ctx, []string{"8/*"}, TestCommandFlags{Output: "yaml"})
+
+	evaluator.AssertCalled(t, "Evaluate", validFilesPathChan, invalidFilesChan, evaluationId)
+	evaluator.AssertNotCalled(t, "PrintFileParsingErrors")
+}
+
+func newValidFilesPathsChan() chan string {
+	validFilesChan := make(chan string, 1)
+
+	go func() {
+		validFilesChan <- "valid/path"
+		close(validFilesChan)
+	}()
+
+	return validFilesChan
+}
+
+func newInvalidFilesChan() chan *validation.InvalidFile {
+	invalidFilesChan := make(chan *validation.InvalidFile, 1)
+
+	invalidFile := &validation.InvalidFile{
+		Path:             "invalid/path",
+		ValidationErrors: []error{},
+	}
+
+	go func() {
+		invalidFilesChan <- invalidFile
+		close(invalidFilesChan)
+	}()
+
+	return invalidFilesChan
+}
+
+func newErrorsChan() chan error {
+	invalidFilesChan := make(chan error, 1)
+
+	close(invalidFilesChan)
+	return invalidFilesChan
+}
diff --git a/cmd/version/main_test.go b/cmd/version/main_test.go
index 2bc3a3d..ba9d67d 100644
--- a/cmd/version/main_test.go
+++ b/cmd/version/main_test.go
@@ -1,39 +1,61 @@
 package version
-//
-//import (
-//	"bytes"
-//	"io/ioutil"
-//	"testing"
-//
-//	"github.com/datreeio/datree/bl/messager"
-//	"github.com/stretchr/testify/mock"
-//)
-//
-//type mockMessager struct {
-//	mock.Mock
-//}
-//
-//func (m *mockMessager) LoadVersionMessages(messages chan *messager.VersionMessage, cliVersion string) {
-//	m.Called(messages, cliVersion)
-//}
-//
-//func Test_ExecuteCommand(t *testing.T) {
-//	messager := &mockMessager{}
-//
-//	cmd := New(&VersionCommandContext{
-//		CliVersion: "1.2.3",
-//		Messager:   messager,
-//	})
-//
-//	// TODO: ask yishay wtf
-//	b := bytes.NewBufferString("1.2.3")
-//	cmd.SetOut(b)
-//	cmd.Execute()
-//	out, err := ioutil.ReadAll(b)
-//	if err != nil {
-//		t.Fatal(err)
-//	}
-//	if string(out) != "1.2.3" {
-//		t.Fatalf("expected \"%s\" got \"%s\"", "1.2.3", string(out))
-//	}
-//}
+
+import (
+	"bytes"
+	"io/ioutil"
+	"testing"
+
+	"github.com/datreeio/datree/bl/messager"
+	"github.com/stretchr/testify/mock"
+)
+
+type printerMock struct {
+	mock.Mock
+}
+
+type mockMessager struct {
+	mock.Mock
+}
+
+func (p *printerMock) PrintMessage(messageText string, messageColor string) {
+	p.Called(messageText, messageColor)
+}
+
+func (m *mockMessager) LoadVersionMessages(messages chan *messager.VersionMessage, cliVersion string) {
+	go func() {
+		messages <- &messager.VersionMessage{
+			CliVersion:   "0.0.1",
+			MessageText:  "message text",
+			MessageColor: "White",
+		}
+
+		close(messages)
+	}()
+
+	m.Called(messages, cliVersion)
+}
+
+func Test_ExecuteCommand(t *testing.T) {
+	messager := &mockMessager{}
+	messager.On("LoadVersionMessages", mock.Anything, mock.Anything).Return(nil)
+
+	printer := &printerMock{}
+	printer.On("PrintMessage", mock.Anything, mock.Anything).Return(nil)
+
+	cmd := New(&VersionCommandContext{
+		CliVersion: "1.2.3",
+		Messager:   messager,
+		Printer: printer,
+	})
+
+	b := bytes.NewBufferString("1.2.3")
+	cmd.SetOut(b)
+	cmd.Execute()
+	out, err := ioutil.ReadAll(b)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if string(out) != "1.2.3" {
+		t.Fatalf("expected \"%s\" got \"%s\"", "1.2.3", string(out))
+	}
+}
diff --git a/pkg/cliClient/cliClient_test.go b/pkg/cliClient/cliClient_test.go
index 3cc4004..27d750a 100644
--- a/pkg/cliClient/cliClient_test.go
+++ b/pkg/cliClient/cliClient_test.go
@@ -1,364 +1,379 @@
 package cliClient
-//
-//import (
-//	"encoding/json"
-//	"io/ioutil"
-//	"net/http"
-//	"path/filepath"
-//	"testing"
-//
-//	"github.com/datreeio/datree/pkg/httpClient"
-//	"github.com/datreeio/datree/pkg/extractor"
-//	"github.com/stretchr/testify/assert"
-//	"github.com/stretchr/testify/mock"
-//)
-//
-//type mockHTTPClient struct {
-//	mock.Mock
-//}
-//
-//func (c *mockHTTPClient) Request(method string, resourceURI string, body interface{}, headers map[string]string) (httpClient.Response, error) {
-//	args := c.Called(method, resourceURI, body, headers)
-//
-//	return args.Get(0).(httpClient.Response), args.Error(1)
-//}
-//
-//type RequestEvaluationTestCase struct {
-//	name string
-//	args struct {
-//		evaluationRequest *EvaluationRequest
-//	}
-//	mock struct {
-//		response struct {
-//			status int
-//			body   *EvaluationResponse
-//		}
-//	}
-//	expected struct {
-//		request struct {
-//			method  string
-//			uri     string
-//			body    *EvaluationRequest
-//			headers map[string]string
-//		}
-//		response *EvaluationResponse
-//	}
-//}
-//
-//type CreateEvaluationTestCase struct {
-//	name string
-//	args struct {
-//		createEvaluationRequest *CreateEvaluationRequest
-//	}
-//	mock struct {
-//		response struct {
-//			status int
-//			body   *CreateEvaluationResponse
-//		}
-//	}
-//	expected struct {
-//		request struct {
-//			method  string
-//			uri     string
-//			body    *CreateEvaluationRequest
-//			headers map[string]string
-//		}
-//		response *CreateEvaluationResponse
-//	}
-//}
-//
-//type GetVersionMessageTestCase struct {
-//	name string
-//	args struct {
-//		cliVersion string
-//	}
-//	mock struct {
-//		response struct {
-//			status int
-//			body   *VersionMessage
-//		}
-//	}
-//	expected struct {
-//		request struct {
-//			method  string
-//			uri     string
-//			body    interface{}
-//			headers map[string]string
-//		}
-//		response *VersionMessage
-//	}
-//}
-//
-//func TestRequestEvaluation(t *testing.T) {
-//	tests := []*RequestEvaluationTestCase{
-//		test_requestEvaluation_success(),
-//	}
-//
-//	httpClientMock := mockHTTPClient{}
-//
-//	for _, tt := range tests {
-//		t.Run(tt.name, func(t *testing.T) {
-//			body, _ := json.Marshal(tt.mock.response.body)
-//			mockedHTTPResponse := httpClient.Response{StatusCode: tt.mock.response.status, Body: body}
-//			httpClientMock.On("Request", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(mockedHTTPResponse, nil)
-//
-//			client := &CliClient{
-//				baseUrl:    "http://cli-service.test.io",
-//				httpClient: &httpClientMock,
-//			}
-//
-//			res, _ := client.RequestEvaluation(tt.args.evaluationRequest)
-//
-//			httpClientMock.AssertCalled(t, "Request", tt.expected.request.method, tt.expected.request.uri, *tt.expected.request.body, tt.expected.request.headers)
-//			assert.Equal(t, *tt.expected.response, res)
-//
-//		})
-//	}
-//}
-//
-//func TestCreateRequestEvaluation(t *testing.T) {
-//	tests := []*CreateEvaluationTestCase{
-//		test_createEvaluation_success(),
-//	}
-//
-//	httpClientMock := mockHTTPClient{}
-//
-//	for _, tt := range tests {
-//		t.Run(tt.name, func(t *testing.T) {
-//			body, _ := json.Marshal(tt.mock.response.body)
-//			mockedHTTPResponse := httpClient.Response{StatusCode: tt.mock.response.status, Body: body}
-//			httpClientMock.On("Request", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(mockedHTTPResponse, nil)
-//
-//			client := &CliClient{
-//				baseUrl:    "http://cli-service.test.io",
-//				httpClient: &httpClientMock,
-//			}
-//
-//			actualEvaluationId, _ := client.CreateEvaluation(tt.args.createEvaluationRequest)
-//
-//			httpClientMock.AssertCalled(t, "Request", tt.expected.request.method, tt.expected.request.uri, *tt.expected.request.body, tt.expected.request.headers)
-//			assert.Equal(t, tt.expected.response.EvaluationId, actualEvaluationId)
-//
-//		})
-//	}
-//}
-//
-//func TestGetVersionMessage(t *testing.T) {
-//	tests := []*GetVersionMessageTestCase{
-//		test_getVersionMessage_success(),
-//	}
-//	httpClientMock := mockHTTPClient{}
-//
-//	for _, tt := range tests {
-//		t.Run(tt.name, func(t *testing.T) {
-//			body, _ := json.Marshal(tt.mock.response.body)
-//			mockedHTTPResponse := httpClient.Response{StatusCode: tt.mock.response.status, Body: body}
-//			httpClientMock.On("Request", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(mockedHTTPResponse, nil)
-//
-//			client := &CliClient{
-//				baseUrl:    "http://cli-service.test.io",
-//				httpClient: &httpClientMock,
-//			}
-//
-//			res, _ := client.GetVersionMessage(tt.args.cliVersion, 1000)
-//			httpClientMock.AssertCalled(t, "Request", tt.expected.request.method, tt.expected.request.uri, tt.expected.request.body, tt.expected.request.headers)
-//			assert.Equal(t, tt.expected.response, res)
-//
-//		})
-//	}
-//}
-//
-//func readMock(path string, data interface{}) error {
-//	absPath, _ := filepath.Abs(path)
-//	f, err := ioutil.ReadFile(absPath)
-//
-//	if err != nil {
-//		return err
-//	}
-//
-//	err = json.Unmarshal(f, data)
-//	if err != nil {
-//		return err
-//	}
-//	return nil
-//}
-//
-//func castPropertiesMock(fileName string, path string) []*extractor.FileConfiguration {
-//	var fileProperties map[string]interface{}
-//	_ = readMock(path, &fileProperties)
-//
-//	properties := []*extractor.FileConfiguration{
-//		{
-//			FileName:       fileName,
-//			Configurations: []extractor.K8sConfiguration{fileProperties},
-//		}}
-//
-//	return properties
-//}
-//
-//func test_getVersionMessage_success() *GetVersionMessageTestCase {
-//	return &GetVersionMessageTestCase{
-//		name: "success - get version message",
-//		args: struct {
-//			cliVersion string
-//		}{
-//			cliVersion: "0.0.1",
-//		},
-//		mock: struct {
-//			response struct {
-//				status int
-//				body   *VersionMessage
-//			}
-//		}{
-//			response: struct {
-//				status int
-//				body   *VersionMessage
-//			}{
-//				status: http.StatusOK,
-//				body:   &VersionMessage{},
-//			},
-//		},
-//		expected: struct {
-//			request struct {
-//				method  string
-//				uri     string
-//				body    interface{}
-//				headers map[string]string
-//			}
-//			response *VersionMessage
-//		}{
-//			request: struct {
-//				method  string
-//				uri     string
-//				body    interface{}
-//				headers map[string]string
-//			}{
-//				method:  http.MethodGet,
-//				uri:     "/cli/messages/versions/0.0.1",
-//				body:    nil,
-//				headers: nil,
-//			},
-//			response: &VersionMessage{},
-//		},
-//	}
-//}
-//
-//func test_requestEvaluation_success() *RequestEvaluationTestCase {
-//	return &RequestEvaluationTestCase{
-//		name: "success - request evaluation",
-//		args: struct {
-//			evaluationRequest *EvaluationRequest
-//		}{
-//			evaluationRequest: &EvaluationRequest{
-//				EvaluationId: 321,
-//				Files:        castPropertiesMock("service_mock", "mocks/service_mock.yaml"),
-//			},
-//		},
-//		mock: struct {
-//			response struct {
-//				status int
-//				body   *EvaluationResponse
-//			}
-//		}{
-//			response: struct {
-//				status int
-//				body   *EvaluationResponse
-//			}{
-//				status: http.StatusOK,
-//				body:   &EvaluationResponse{},
-//			},
-//		},
-//		expected: struct {
-//			request struct {
-//				method  string
-//				uri     string
-//				body    *EvaluationRequest
-//				headers map[string]string
-//			}
-//			response *EvaluationResponse
-//		}{
-//			request: struct {
-//				method  string
-//				uri     string
-//				body    *EvaluationRequest
-//				headers map[string]string
-//			}{
-//				method: http.MethodPost,
-//				uri:    "/cli/evaluate",
-//				body: &EvaluationRequest{
-//					EvaluationId: 321,
-//					Files:        castPropertiesMock("service_mock", "mocks/service_mock.yaml"),
-//				},
-//				headers: nil,
-//			},
-//			response: &EvaluationResponse{},
-//		},
-//	}
-//}
-//
-//func test_createEvaluation_success() *CreateEvaluationTestCase {
-//	return &CreateEvaluationTestCase{
-//		name: "success - create evaluation",
-//		args: struct {
-//			createEvaluationRequest *CreateEvaluationRequest
-//		}{
-//			createEvaluationRequest: &CreateEvaluationRequest{
-//				CliId: "cli_id",
-//				Metadata: Metadata{
-//					CliVersion:      "0.0.1",
-//					Os:              "darwin",
-//					PlatformVersion: "1.2.3",
-//					KernelVersion:   "4.5.6",
-//				},
-//			},
-//		},
-//		mock: struct {
-//			response struct {
-//				status int
-//				body   *CreateEvaluationResponse
-//			}
-//		}{
-//			response: struct {
-//				status int
-//				body   *CreateEvaluationResponse
-//			}{
-//				status: http.StatusOK,
-//				body: &CreateEvaluationResponse{
-//					EvaluationId: 123,
-//				},
-//			},
-//		},
-//		expected: struct {
-//			request struct {
-//				method  string
-//				uri     string
-//				body    *CreateEvaluationRequest
-//				headers map[string]string
-//			}
-//			response *CreateEvaluationResponse
-//		}{
-//			request: struct {
-//				method  string
-//				uri     string
-//				body    *CreateEvaluationRequest
-//				headers map[string]string
-//			}{
-//				method: http.MethodPost,
-//				uri:    "/cli/evaluation/create",
-//				body: &CreateEvaluationRequest{
-//					CliId: "cli_id",
-//					Metadata: Metadata{
-//						CliVersion:      "0.0.1",
-//						Os:              "darwin",
-//						PlatformVersion: "1.2.3",
-//						KernelVersion:   "4.5.6",
-//					},
-//				},
-//				headers: nil,
-//			},
-//			response: &CreateEvaluationResponse{
-//				EvaluationId: 123,
-//			},
-//		},
-//	}
-//}
+
+import (
+	"bytes"
+	"encoding/json"
+	"gopkg.in/yaml.v3"
+	"io/ioutil"
+	"net/http"
+	"path/filepath"
+	"testing"
+
+	"github.com/datreeio/datree/pkg/extractor"
+	"github.com/datreeio/datree/pkg/httpClient"
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/mock"
+)
+
+type mockHTTPClient struct {
+	mock.Mock
+}
+
+func (c *mockHTTPClient) Request(method string, resourceURI string, body interface{}, headers map[string]string) (httpClient.Response, error) {
+	args := c.Called(method, resourceURI, body, headers)
+
+	return args.Get(0).(httpClient.Response), args.Error(1)
+}
+
+func (c *mockHTTPClient) name()  {
+
+}
+
+type RequestEvaluationTestCase struct {
+	name string
+	args struct {
+		evaluationRequest *EvaluationRequest
+	}
+	mock struct {
+		response struct {
+			status int
+			body   *EvaluationResponse
+		}
+	}
+	expected struct {
+		request struct {
+			method  string
+			uri     string
+			body    *EvaluationRequest
+			headers map[string]string
+		}
+		response *EvaluationResponse
+	}
+}
+
+type CreateEvaluationTestCase struct {
+	name string
+	args struct {
+		createEvaluationRequest *CreateEvaluationRequest
+	}
+	mock struct {
+		response struct {
+			status int
+			body   *CreateEvaluationResponse
+		}
+	}
+	expected struct {
+		request struct {
+			method  string
+			uri     string
+			body    *CreateEvaluationRequest
+			headers map[string]string
+		}
+		response *CreateEvaluationResponse
+	}
+}
+
+type GetVersionMessageTestCase struct {
+	name string
+	args struct {
+		cliVersion string
+	}
+	mock struct {
+		response struct {
+			status int
+			body   *VersionMessage
+		}
+	}
+	expected struct {
+		request struct {
+			method  string
+			uri     string
+			body    interface{}
+			headers map[string]string
+		}
+		response *VersionMessage
+	}
+}
+
+func TestRequestEvaluation(t *testing.T) {
+	tests := []*RequestEvaluationTestCase{
+		test_requestEvaluation_success(),
+	}
+
+	httpClientMock := mockHTTPClient{}
+
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			body, _ := json.Marshal(tt.mock.response.body)
+			mockedHTTPResponse := httpClient.Response{StatusCode: tt.mock.response.status, Body: body}
+			httpClientMock.On("Request", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(mockedHTTPResponse, nil)
+
+			client := &CliClient{
+				baseUrl:    "http://cli-service.test.io",
+				httpClient: &httpClientMock,
+			}
+
+			res, _ := client.RequestEvaluation(tt.args.evaluationRequest)
+
+			httpClientMock.AssertCalled(t, "Request", tt.expected.request.method, tt.expected.request.uri, tt.expected.request.body, tt.expected.request.headers)
+			assert.Equal(t, tt.expected.response, res)
+
+		})
+	}
+}
+
+func TestCreateRequestEvaluation(t *testing.T) {
+	tests := []*CreateEvaluationTestCase{
+		test_createEvaluation_success(),
+	}
+
+	httpClientMock := mockHTTPClient{}
+
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			body, _ := json.Marshal(tt.mock.response.body)
+			mockedHTTPResponse := httpClient.Response{StatusCode: tt.mock.response.status, Body: body}
+			httpClientMock.On("Request", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(mockedHTTPResponse, nil)
+
+			client := &CliClient{
+				baseUrl:    "http://cli-service.test.io",
+				httpClient: &httpClientMock,
+			}
+
+			actualEvaluationId, _ := client.CreateEvaluation(tt.args.createEvaluationRequest)
+
+			httpClientMock.AssertCalled(t, "Request", tt.expected.request.method, tt.expected.request.uri, tt.expected.request.body, tt.expected.request.headers)
+			assert.Equal(t, tt.expected.response.EvaluationId, actualEvaluationId)
+
+		})
+	}
+}
+
+func TestGetVersionMessage(t *testing.T) {
+	tests := []*GetVersionMessageTestCase{
+		test_getVersionMessage_success(),
+	}
+	httpClientMock := mockHTTPClient{}
+
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			body, _ := json.Marshal(tt.mock.response.body)
+			mockedHTTPResponse := httpClient.Response{StatusCode: tt.mock.response.status, Body: body}
+			httpClientMock.On("Request", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(mockedHTTPResponse, nil)
+
+
+			client := &CliClient{
+				baseUrl:    "http://cli-service.test.io",
+				timeoutClient: &httpClientMock,
+			}
+
+			res, _ := client.GetVersionMessage(tt.args.cliVersion, 1000)
+			httpClientMock.AssertCalled(t, "Request", tt.expected.request.method, tt.expected.request.uri, tt.expected.request.body, tt.expected.request.headers)
+			assert.Equal(t, tt.expected.response, res)
+
+		})
+	}
+}
+
+func readMock(path string) ([]extractor.K8sConfiguration, error) {
+	var configurations []extractor.K8sConfiguration
+
+	absPath, _ := filepath.Abs(path)
+	content, err := ioutil.ReadFile(absPath)
+
+	if err != nil {
+		return []extractor.K8sConfiguration{}, err
+	}
+
+	yamlDecoder := yaml.NewDecoder(bytes.NewReader(content))
+
+	for {
+		var doc = map[string]interface{}{}
+		err = yamlDecoder.Decode(&doc)
+		if err != nil {
+			break
+		}
+		configurations = append(configurations, doc)
+	}
+
+	return configurations, nil
+}
+
+func castPropertiesMock(fileName string, path string) []*extractor.FileConfiguration {
+	configurations, _ := readMock(path)
+
+	properties := []*extractor.FileConfiguration{
+		{
+			FileName:       fileName,
+			Configurations: configurations,
+		}}
+
+	return properties
+}
+
+func test_getVersionMessage_success() *GetVersionMessageTestCase {
+	return &GetVersionMessageTestCase{
+		name: "success - get version message",
+		args: struct {
+			cliVersion string
+		}{
+			cliVersion: "0.0.1",
+		},
+		mock: struct {
+			response struct {
+				status int
+				body   *VersionMessage
+			}
+		}{
+			response: struct {
+				status int
+				body   *VersionMessage
+			}{
+				status: http.StatusOK,
+				body:   &VersionMessage{},
+			},
+		},
+		expected: struct {
+			request struct {
+				method  string
+				uri     string
+				body    interface{}
+				headers map[string]string
+			}
+			response *VersionMessage
+		}{
+			request: struct {
+				method  string
+				uri     string
+				body    interface{}
+				headers map[string]string
+			}{
+				method:  http.MethodGet,
+				uri:     "/cli/messages/versions/0.0.1",
+				body:    nil,
+				headers: nil,
+			},
+			response: &VersionMessage{},
+		},
+	}
+}
+
+func test_requestEvaluation_success() *RequestEvaluationTestCase {
+	return &RequestEvaluationTestCase{
+		name: "success - request evaluation",
+		args: struct {
+			evaluationRequest *EvaluationRequest
+		}{
+			evaluationRequest: &EvaluationRequest{
+				EvaluationId: 321,
+				Files:        castPropertiesMock("service_mock", "mocks/service_mock.yaml"),
+			},
+		},
+		mock: struct {
+			response struct {
+				status int
+				body   *EvaluationResponse
+			}
+		}{
+			response: struct {
+				status int
+				body   *EvaluationResponse
+			}{
+				status: http.StatusOK,
+				body:   &EvaluationResponse{},
+			},
+		},
+		expected: struct {
+			request struct {
+				method  string
+				uri     string
+				body    *EvaluationRequest
+				headers map[string]string
+			}
+			response *EvaluationResponse
+		}{
+			request: struct {
+				method  string
+				uri     string
+				body    *EvaluationRequest
+				headers map[string]string
+			}{
+				method: http.MethodPost,
+				uri:    "/cli/evaluate",
+				body: &EvaluationRequest{
+					EvaluationId: 321,
+					Files:        castPropertiesMock("service_mock", "mocks/service_mock.yaml"),
+				},
+				headers: nil,
+			},
+			response: &EvaluationResponse{},
+		},
+	}
+}
+
+func test_createEvaluation_success() *CreateEvaluationTestCase {
+	return &CreateEvaluationTestCase{
+		name: "success - create evaluation",
+		args: struct {
+			createEvaluationRequest *CreateEvaluationRequest
+		}{
+			createEvaluationRequest: &CreateEvaluationRequest{
+				CliId: "cli_id",
+				Metadata: &Metadata{
+					CliVersion:      "0.0.1",
+					Os:              "darwin",
+					PlatformVersion: "1.2.3",
+					KernelVersion:   "4.5.6",
+				},
+			},
+		},
+		mock: struct {
+			response struct {
+				status int
+				body   *CreateEvaluationResponse
+			}
+		}{
+			response: struct {
+				status int
+				body   *CreateEvaluationResponse
+			}{
+				status: http.StatusOK,
+				body: &CreateEvaluationResponse{
+					EvaluationId: 123,
+				},
+			},
+		},
+		expected: struct {
+			request struct {
+				method  string
+				uri     string
+				body    *CreateEvaluationRequest
+				headers map[string]string
+			}
+			response *CreateEvaluationResponse
+		}{
+			request: struct {
+				method  string
+				uri     string
+				body    *CreateEvaluationRequest
+				headers map[string]string
+			}{
+				method: http.MethodPost,
+				uri:    "/cli/evaluation/create",
+				body: &CreateEvaluationRequest{
+					CliId: "cli_id",
+					Metadata: &Metadata{
+						CliVersion:      "0.0.1",
+						Os:              "darwin",
+						PlatformVersion: "1.2.3",
+						KernelVersion:   "4.5.6",
+					},
+				},
+				headers: nil,
+			},
+			response: &CreateEvaluationResponse{
+				EvaluationId: 123,
+			},
+		},
+	}
+}