// TestRefreshVersion get the latest version being used from api
func TestRefreshVersion(t *testing.T) {
	var (
		d *ICSPTest
		c *icsp.ICSPClient
	)
	if os.Getenv("ICSP_TEST_ACCEPTANCE") == "true" {
		d, c = getTestDriverA()
		if c == nil {
			t.Fatalf("Failed to execute getTestDriver() ")
		}
		c.APIVersion = -1
		assert.Equal(t, -1, c.APIVersion)
		err := c.RefreshVersion()
		assert.NoError(t, err, "RefreshVersion threw error -> %s", err)
		assert.True(t, d.Tc.EqualFaceI(d.Tc.GetExpectsData(d.Env+"_icsp", "CurrentVersion"), c.APIVersion))
	} else {
		_, c = getTestDriverU()
		err := c.RefreshVersion()
		assert.Error(t, err, fmt.Sprintf("ALL ok, no error, caught as expected: %s", err))
	}

}