Josephson junctions in a local inhomogeneous magnetic field