I posted a similar question on Quantitative Finance Stack Exchange a while ago. It has not received any answers, thus I am reposting a version of it here in the hope of finding a larger pool of experts.
Suppose we are interested in testing the Capital Asset Pricing Model (CAPM) using data on $N$ assets observed for $T$ time periods. The CAPM states that $$ E(R^{ei})=\beta_i E(f) \tag{*} $$ where $R^{ei}$ is the excess return on an asset $i$, $f$ is the excess return on the market portfolio and $\beta_i\equiv\frac{\text{Cov}(R^{ei},f)}{\text{Var}(f)}$. While the CAPM is a single-period model, let us assume it works in $T$ time periods so that $E(R^{ei}_t)=\beta_i E(f_t)$ where $E(f_t)\equiv E(f)\equiv\lambda$. Let us also assume the relevant covariances and variances and thus also $\beta$s are constant over time, too.
According to Cochrane "Asset Pricing" (2005) Chapter 12, the Gibbons, Ross and Shanken (GRS) test of the CAPM (GRS, 1989) amounts to running $N$ time series regressions of the form $$ R^{ei}_t=\alpha_i+\beta_i f_t+\varepsilon^i_t \tag{12.1} $$ and testing the joint hypothesis $H_0\colon \alpha_1=\dots=\alpha_N=0$.
Now, I do see how setting $\alpha_1=\dots=\alpha_N=0$ in $(12.1)$ and integrating w.r.t. $f_t$ implies $(*)$. However, I do not think that $(*)$ implies $\alpha_1=\dots=\alpha_N=0$ in $(12.1)$. I am only able to get the following:
$$
R^{ei}_t = 0+\beta_i E(f)+\varepsilon^i_t. \tag{12.1'}
$$
It is as if we have measurement error in $(12.1)$ compared to $(12.1')$, as $f_t$ gets in place of $E(f)$.
How do I reconcile $(12.1)$ with $(12.1')$ so that the GRS test makes sense?