@Test public void testInvalidInputString() { initialize(); try { RouterUtils.getBlobIdFromString(null, clusterMap); fail("The input blob string is invalid. Should fail here"); } catch (RouterException e) { assertEquals("The input blob string is invalid.", e.getErrorCode(), RouterErrorCode.InvalidBlobId); } try { RouterUtils.getBlobIdFromString("", clusterMap); fail("The input blob string is invalid. Should fail here"); } catch (RouterException e) { assertEquals("", e.getErrorCode(), RouterErrorCode.InvalidBlobId); } try { RouterUtils.getBlobIdFromString("abc", clusterMap); fail("The input blob string is invalid. Should fail here"); } catch (RouterException e) { assertEquals("", e.getErrorCode(), RouterErrorCode.InvalidBlobId); } }
static BlobId getBlobIdFromString(String blobIdString, ClusterMap clusterMap) throws RouterException { BlobId blobId; try { blobId = new BlobId(blobIdString, clusterMap); logger.trace("BlobId {} created with partitionId {}", blobId, blobId.getPartition()); } catch (Exception e) { logger.trace("Caller passed in invalid BlobId {}", blobIdString); throw new RouterException("BlobId is invalid " + blobIdString, RouterErrorCode.InvalidBlobId); } return blobId; }
RouterUtils { static BlobId getBlobIdFromString(String blobIdString, ClusterMap clusterMap) throws RouterException { BlobId blobId; try { blobId = new BlobId(blobIdString, clusterMap); logger.trace("BlobId {} created with partitionId {}", blobId, blobId.getPartition()); } catch (Exception e) { logger.trace("Caller passed in invalid BlobId {}", blobIdString); throw new RouterException("BlobId is invalid " + blobIdString, RouterErrorCode.InvalidBlobId); } return blobId; } }
RouterUtils { static BlobId getBlobIdFromString(String blobIdString, ClusterMap clusterMap) throws RouterException { BlobId blobId; try { blobId = new BlobId(blobIdString, clusterMap); logger.trace("BlobId {} created with partitionId {}", blobId, blobId.getPartition()); } catch (Exception e) { logger.trace("Caller passed in invalid BlobId {}", blobIdString); throw new RouterException("BlobId is invalid " + blobIdString, RouterErrorCode.InvalidBlobId); } return blobId; }  }
RouterUtils { static BlobId getBlobIdFromString(String blobIdString, ClusterMap clusterMap) throws RouterException { BlobId blobId; try { blobId = new BlobId(blobIdString, clusterMap); logger.trace("BlobId {} created with partitionId {}", blobId, blobId.getPartition()); } catch (Exception e) { logger.trace("Caller passed in invalid BlobId {}", blobIdString); throw new RouterException("BlobId is invalid " + blobIdString, RouterErrorCode.InvalidBlobId); } return blobId; }   }
RouterUtils { static BlobId getBlobIdFromString(String blobIdString, ClusterMap clusterMap) throws RouterException { BlobId blobId; try { blobId = new BlobId(blobIdString, clusterMap); logger.trace("BlobId {} created with partitionId {}", blobId, blobId.getPartition()); } catch (Exception e) { logger.trace("Caller passed in invalid BlobId {}", blobIdString); throw new RouterException("BlobId is invalid " + blobIdString, RouterErrorCode.InvalidBlobId); } return blobId; }    }