### Question:
MtasApiServiceImpl implements MtasApiService { protected ResponseEntity<List<Mta>> getMtasByName(String spaceGuid, String name) { List<DeployedMta> deployedMtas = deployedMtaDetector.detectDeployedMtasByName(name, getCloudFoundryClient(spaceGuid)); if (deployedMtas.isEmpty()) { throw new NotFoundException(Messages.MTAS_NOT_FOUND_BY_NAME, name); } return ResponseEntity.ok() .body(getMtas(deployedMtas)); }  @Override ResponseEntity<List<Mta>> getMtas(String spaceGuid); @Override ResponseEntity<Mta> getMta(String spaceGuid, String mtaId); @Override ResponseEntity<List<Mta>> getMtas(String spaceGuid, String namespace, String name);  }### Answer:
@Test void testGetMtasByName() { Mta mtaToGet = mtas.get(1); Mockito.when(deployedMtaDetector.detectDeployedMtasByName(mtaToGet.getMetadata() .getId(), client)) .thenReturn(List.of(getDeployedMta(mtaToGet))); ResponseEntity<List<Mta>> response = testedClass.getMtas(SPACE_GUID, null, mtaToGet.getMetadata() .getId()); assertEquals(HttpStatus.OK, response.getStatusCode()); List<Mta> responseMtas = response.getBody(); assertEquals(List.of(mtaToGet), responseMtas); }