Let $X_1,X_2,\dots,X_n$ be iid random sample from $U(0,\theta)$ for $\theta>0$. Consider testing the null hypothesis $H_0:\theta\leq1$ vs the alternative hypothesis $H_A:\theta>1$ at level $\alpha$. Show that the following randomized test is uniformly most powerful $$ T(X)= \begin{cases} 1,&\;\;X_{(n)}\geq1\\ \alpha,&\;\;X_{(n)}<1 \end{cases} $$
The CDF of $X_{(n)}$ is $F(x)=\left(\frac{x}{\theta}\right)^n$. The power function I have for this test is $$ \beta(\theta)= \begin{cases} \alpha\left(\frac{1}{\theta}\right)^n+1-\frac{1}{\theta^n}&\;\;\theta>1\\ \alpha\left(\frac{\alpha}{\theta}\right)^n&\;\;\theta\leq1 \end{cases} $$
I am not sure how show this is UMP.