<commit_before>package main

import (
	"fmt"
	"log"
	"testing"

	net "net/http"

	"github.com/geodan/gost/src/configuration"
	"github.com/geodan/gost/src/database/postgis"
	"github.com/geodan/gost/src/http"
	"github.com/geodan/gost/src/mqtt"
	"github.com/geodan/gost/src/sensorthings/api"
	"github.com/stretchr/testify/assert"
)

func TestVersionHandler(t *testing.T) {
	log.Println("do test")
	//arrange
	cfg := configuration.Config{}
	mqttServer := mqtt.CreateMQTTClient(configuration.MQTTConfig{})
	// database := postgis.NewDatabase("", 123, "", "", "", "", false, 50, 100)
	database := postgis.NewDatabase("192.168.40.10", 5432, "postgres", "postgres", "gost", "v1", false, 50, 100)
	api := api.NewAPI(database, cfg, mqttServer)

	gostServer := http.CreateServer("localhost", 8088, &api)
	gostServer.Start()
	versionUrl := fmt.Sprintf("%s/Version", "http://localhost:8088")

	// act
	request, _ := net.NewRequest("GET", versionUrl, nil)
	res, _ := net.DefaultClient.Do(request)<commit_msg>fix more more<commit_after>package main

import (
	"fmt"
	"log"
	"testing"

	net "net/http"

	"github.com/geodan/gost/src/configuration"
	"github.com/geodan/gost/src/database/postgis"
	"github.com/geodan/gost/src/http"
	"github.com/geodan/gost/src/mqtt"
	"github.com/geodan/gost/src/sensorthings/api"
	"github.com/stretchr/testify/assert"
)

func TestVersionHandler(t *testing.T) {
	log.Println("do test")
	//arrange
	cfg := configuration.Config{}
	mqttServer := mqtt.CreateMQTTClient(configuration.MQTTConfig{})
	database := postgis.NewDatabase("", 123, "", "", "", "", false, 50, 100)
	api := api.NewAPI(database, cfg, mqttServer)

	gostServer := http.CreateServer("localhost", 8088, &api)
	go gostServer.Start()
	versionUrl := fmt.Sprintf("%s/Version", "http://localhost:8088")

	// act
	request, _ := net.NewRequest("GET", versionUrl, nil)
	res, _ := net.DefaultClient.Do(request)
{'fraction_non_alphanumeric': 0.1853035143769968, 'fraction_numerical': 0.027689030883919063, 'mean_word_length': 4.965079365079365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6309314', 'n_tokens_mistral': 779, 'n_tokens_neox': 725, 'n_words': 110}