  In incomplete financial markets not every contingent claim can be replicated
by a self-financing strategy. The risk of the resulting shortfall can be
measured by convex risk measures, recently introduced by F\"ollmer, Schied
(2002). The dynamic optimization problem of finding a self-financing strategy
that minimizes the convex risk of the shortfall can be split into a static
optimization problem and a representation problem. It follows that the optimal
strategy consists in superhedging the modified claim $\widetilde{\varphi}H$,
where $H$ is the payoff of the claim and $\widetilde{\varphi}$ is the solution
of the static optimization problem, the optimal randomized test.
  In this paper, we will deduce necessary and sufficient optimality conditions
for the static problem using convex duality methods. The solution of the static
optimization problem turns out to be a randomized test with a typical
$0$-$1$-structure.
