class MtasApiServiceImpl implements MtasApiService {

    protected ResponseEntity<List<Mta>> getMtasByNamespace(String spaceGuid, String namespace) {
        List<DeployedMta> deployedMtas = deployedMtaDetector.detectDeployedMtasByNamespace(namespace, getCloudFoundryClient(spaceGuid));

        if (deployedMtas.isEmpty()) {
            throw new NotFoundException(Messages.MTAS_NOT_FOUND_BY_NAMESPACE, namespace);
        }

        return ResponseEntity.ok()
                             .body(getMtas(deployedMtas));
    }

}