@Test
  public void testBadSegmentSubResourceNumber() throws UnsupportedEncodingException, URISyntaxException {
    String requestPath = "/mediaExpectedOpOrId/Segment/notAnInteger";
    List<String> prefixesToRemove = new ArrayList<>();
    RestRequest restRequest = RestUtilsTest.createRestRequest(RestMethod.GET, requestPath, null);
    try {
      RequestPath.parse(restRequest, prefixesToRemove, CLUSTER_NAME);
      fail();
    } catch (RestServiceException e) {
      assertEquals(RestServiceErrorCode.BadRequest, e.getErrorCode());
    }
  }
Tests that the expected exception is thrown when a Segment request comes in without a valid
integer index
@throws UnsupportedEncodingException
@throws URISyntaxException
ambry-api/src/test/java/com/github/ambry/rest/RequestPathTest.java