func TestVersionCheckUpdateAvailable(t *testing.T) {
	assert := test.NewAssert(t)

	warningMsg := "Version v0.1.2 of the Conformance Suite is out-of-date, please update to v0.1.3"
	updateAvaiable := true
	v := makeVersionMock(warningMsg, updateAvaiable)
	server := NewServer(testJourney(), nullLogger(), v)
	defer func() {
		require.NoError(t, server.Shutdown(context.TODO()))
	}()

	code, body, headers := request(http.MethodGet, "/api/version", nil, server)

	assert.NotNil(body)
	expected := fmt.Sprintf(`{"version":"%s", "message":"%s", "update":%t}`, humanVersion, warningMsg, updateAvaiable)
	assert.JSONEq(body.String(), expected)

	assert.Equal(http.StatusOK, code)
	assert.Equal(expectedJSONHeaders(), headers)
}
// TestVersionCheckUpdateAvailable provided a version that is lower than the available
// version, a response denoting an available update should be returned.
TestVersionCheckUpdateAvailable provided a version that is lower than the available
version, a response denoting an available update should be returned.
// TestVersionCheckUpdateAvailable provided a version that is lower than the available // version a response denoting an available update should be returned .
func TestVersionCheckUpdateAvailable(t *testing.T) {
	assert := test.NewAssert(t)
	warningMsg := "Version v0.1.2 of the Conformance Suite is out-of-date, please update to v0.1.3"
	updateAvaiable := true
	v := makeVersionMock(warningMsg, updateAvaiable)
	server := NewServer(testJourney(), nullLogger(), v)
	defer func() {
		require.NoError(t, server.Shutdown(context.TODO()))
	}()
	code, body, headers := request(http.MethodGet, "/api/version", nil, server)
	assert.NotNil(body)
	expected := fmt.Sprintf(`{"version":"%s", "message":"%s", "update":%t}`, humanVersion, warningMsg, updateAvaiable)
	assert.JSONEq(body.String(), expected)
	assert.Equal(http.StatusOK, code)
	assert.Equal(expectedJSONHeaders(), headers)
}
func TestVersionCheckUpdateAvailable ( t * testing . T ) { assert := test . NewAssert ( t ) warningMsg := " " updateAvaiable := true v := makeVersionMock ( warningMsg , updateAvaiable ) server := NewServer ( testJourney ( ) , nullLogger ( ) , v ) defer func ( ) { require . NoError ( t , server . Shutdown ( context . TODO ( ) ) ) } ( ) code , body , headers := request ( http . MethodGet , " " , nil , server ) assert . NotNil ( body ) expected := fmt . Sprintf ( `{"version":"%s", "message":"%s", "update":%t}` , humanVersion , warningMsg , updateAvaiable ) assert . JSONEq ( body . String ( ) , expected ) assert . Equal ( http . StatusOK , code ) assert . Equal ( expectedJSONHeaders ( ) , headers ) }
TestVersionCheckUpdateAvailable provided a version that is lower than the available
version, a response denoting an available update should be returned.
TestVersionCheckUpdateAvailable provided a version that is lower than the available version a response denoting an available update should be returned .