def test_options_with_auth(self):
    self._jar_publish._jvm_options = self._default_jvm_opts()

    username = 'mjk'
    password = 'h.'
    creds_options = ['-Dlogin={}'.format(username), '-Dpassword={}'.format(password)]

    repo = {
      'auth': 'blah',
      'username': username,
      'password': password,
    }
    modified_opts = self._jar_publish._ivy_jvm_options(repo)
    self.assertEqual(modified_opts, self._default_jvm_opts() + creds_options)

    # Now run it again, and make sure we don't get dupes.
    modified_opts = self._jar_publish._ivy_jvm_options(repo)
    self.assertEqual(modified_opts, self._default_jvm_opts() + creds_options)
`JarPublish._ivy_jvm_options()` should produce the same list, when called multiple times
dataset/ETHPy150Open pantsbuild/pants/tests/python/pants_test/backend/jvm/tasks/test_jar_publish.py/JarPublishAuthTest.test_options_with_auth