Cross post Optimal hypothesis testing uses sufficient statistics?.
In statistical estimation with any convex risk for a model with a sufficient statistic, in seeking optimal estimators it suffices to consider functions of the sufficient statistic. This follows from (conditional) Jensen's inequality: if $g$ is an estimator for $\theta$ and $T=T(X)$ is a sufficient statistic, then $h(X)=E[g(X)|T]$ is an estimator of $\theta$ satisfying $R(h,\theta)\leq R(g,\theta)$ for all $\theta$, where $R$ denotes the risk.
My question is, does a version of this result hold in hypothesis testing? That is, the goal is to define a test (i.e. a function $\phi$ of the data with $\phi(X)\in\{0,1\}$ with optimality properties, say a good sum of type I and type II error, and the conclusion would be that it suffices to consider tests depending only on the sufficient statistic $T(X)$. Note that directly applying the same argument doesn't give anything useful: $E[\phi(X)\mid T]$ is no longer a hypothesis test since it takes values in $[0,1]$.
References of any kind welcome: I suspect there may be lecture notes with some result of this kind, I just haven't been able to find any.