/** * Builds a Get Storage response. * * @param response the response. * @param uri the URI of the incoming request. * * @throws JAXBException if a JAXB error occurred. */ private void buildGetStorageResponse(MockCloseableHttpResponse response, URI uri) throws JAXBException { Pattern pattern = Pattern.compile("/herd-app/rest/storages/(.*)"); Matcher matcher = pattern.matcher(uri.getPath()); if (matcher.find()) { Storage storage = getNewStorage(matcher.group(1)); response.setEntity(getHttpEntity(storage)); } }
storageUnits.add(storageUnit); storageUnit.setStorage(getNewStorage(StorageEntity.MANAGED_STORAGE));