German soldier posed as Syrian refugee and ‘planned attack’