Repository: getmoto/moto

Issue:
Batch client should return jobArn on submit_job
Looks like jobArn isn't being returned by the batch client after calling submit_job

I believe it should per the [boto3 docs](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/batch/client/submit_job.html) and [AWS API docs](https://docs.aws.amazon.com/batch/latest/APIReference/API_SubmitJob.html). I may be confused though, since the docs also show without jobArn.

Looks like the return structure is set [here](https://github.com/getmoto/moto/blob/master/moto/batch/models.py#L1792) and can get the ARN from job.arn


Discussion:
Thanks for raising this @KidAmnesiac1, and welcome to Moto! I'll submit a PR for this shortly.

Resolving patch:
diff --git a/moto/batch/models.py b/moto/batch/models.py
--- a/moto/batch/models.py
+++ b/moto/batch/models.py
@@ -1734,7 +1734,7 @@ def submit_job(
         depends_on: Optional[List[Dict[str, str]]] = None,
         container_overrides: Optional[Dict[str, Any]] = None,
         timeout: Optional[Dict[str, int]] = None,
-    ) -> Tuple[str, str]:
+    ) -> Tuple[str, str, str]:
         """
         Parameters RetryStrategy and Parameters are not yet implemented.
         """
@@ -1789,7 +1789,7 @@ def submit_job(
         else:
             # Here comes the fun
             job.start()
-        return job_name, job.job_id
+        return job_name, job.job_id, job.arn
 
     def describe_jobs(self, jobs: Optional[List[str]]) -> List[Dict[str, Any]]:
         job_filter = set()
diff --git a/moto/batch/responses.py b/moto/batch/responses.py
--- a/moto/batch/responses.py
+++ b/moto/batch/responses.py
@@ -212,7 +212,7 @@ def submitjob(self) -> str:
         timeout = self._get_param("timeout")
         array_properties = self._get_param("arrayProperties", {})
 
-        name, job_id = self.batch_backend.submit_job(
+        name, job_id, job_arn = self.batch_backend.submit_job(
             job_name,
             job_def,
             job_queue,
@@ -222,7 +222,7 @@ def submitjob(self) -> str:
             array_properties=array_properties,
         )
 
-        result = {"jobId": job_id, "jobName": name}
+        result = {"jobId": job_id, "jobName": name, "jobArn": job_arn}
 
         return json.dumps(result)
 
diff --git a/moto/batch_simple/models.py b/moto/batch_simple/models.py
--- a/moto/batch_simple/models.py
+++ b/moto/batch_simple/models.py
@@ -61,7 +61,7 @@ def submit_job(
         depends_on: Optional[List[Dict[str, str]]] = None,
         container_overrides: Optional[Dict[str, Any]] = None,
         timeout: Optional[Dict[str, int]] = None,
-    ) -> Tuple[str, str]:
+    ) -> Tuple[str, str, str]:
         # Look for job definition
         job_def = self.get_job_definition(job_def_id)
         if job_def is None:
@@ -106,7 +106,7 @@ def submit_job(
         else:
             self._mark_job_as_finished(include_start_attempt=True, job=job)
 
-        return job_name, job.job_id
+        return job_name, job.job_id, job.arn
 
     def _mark_job_as_finished(self, include_start_attempt: bool, job: Job) -> None:
         self.backend._jobs[job.job_id] = job


Test patch:
diff --git a/tests/test_batch/test_batch_jobs.py b/tests/test_batch/test_batch_jobs.py
--- a/tests/test_batch/test_batch_jobs.py
+++ b/tests/test_batch/test_batch_jobs.py
@@ -1,12 +1,13 @@
-from . import _get_clients, _setup
-
-import datetime
-from moto import mock_batch, mock_iam, mock_ec2, mock_ecs, mock_logs
 import botocore.exceptions
+import datetime
 import pytest
 import time
 from uuid import uuid4
 
+from moto import mock_batch, mock_iam, mock_ec2, mock_ecs, mock_logs
+from tests import DEFAULT_ACCOUNT_ID
+
+from . import _get_clients, _setup
 from ..markers import requires_docker
 
 
@@ -86,10 +87,15 @@ def test_submit_job_by_name():
     assert resp_jobs["jobs"][0]["jobDefinition"] == job_definition_arn
 
 
+# SLOW TESTS
+
+
 @mock_ec2
 @mock_ecs
 @mock_iam
 @mock_batch
+@pytest.mark.network
+@requires_docker
 def test_submit_job_array_size():
     # Setup
     job_definition_name = f"sleep10_{str(uuid4())[0:6]}"
@@ -130,9 +136,6 @@ def test_submit_job_array_size():
     assert len(child_job_1["attempts"]) == 1
 
 
-# SLOW TESTS
-
-
 @mock_logs
 @mock_ec2
 @mock_ecs
@@ -1024,13 +1027,19 @@ def test_submit_job_with_timeout():
     commands = ["sleep", "30"]
     job_def_arn, queue_arn = prepare_job(batch_client, commands, iam_arn, job_def_name)
 
+    job_name = str(uuid4())[0:6]
     resp = batch_client.submit_job(
-        jobName=str(uuid4())[0:6],
+        jobName=job_name,
         jobQueue=queue_arn,
         jobDefinition=job_def_arn,
         timeout={"attemptDurationSeconds": 1},
     )
     job_id = resp["jobId"]
+    assert resp["jobName"] == job_name
+    assert (
+        resp["jobArn"]
+        == f"arn:aws:batch:eu-central-1:{DEFAULT_ACCOUNT_ID}:job/{job_id}"
+    )
 
     # This should fail, as the job-duration is longer than the attemptDurationSeconds
     _wait_for_job_status(batch_client, job_id, "FAILED")