I have the following negative test code (needs to fail and throw an exception):

```
@Test
public void testInventoryControllerGetNonExistingRegion() {

    final String name = "ME_2";
    RegionConfiguration refRegionConfiguration = prepareReferenceObject(name);

    try(
        inventoryRegionController.get(null,name);
    } catch (EntityDoesNotExistException e){

        //report something...
    }
}

```

The test calls the following method get() and SHOULD throw an EntityDoesNotExistException object.

```
@ApiOperation(value = "Get a region")
@RequestMapping(value = "regions/{" + REGION + "}", method = RequestMethod.GET)
public RegionConfiguration get(@RequestHeader(value = AUTHORIZATION_HEADER, defaultValue = "Bearer {{JWT}}") String authorization,
                               @PathVariable(REGION) String regionName) throws EntityDoesNotExistException {

    InventoryRegionEntity inventoryRegionEntity = null;
    inventoryRegionEntity = RegionInventoryService.find(regionName);

    if(null != inventoryRegionEntity)
        return RegionConfigurationMapper.mapInventoryRegionEntity(inventoryRegionEntity);
    else
        throw new EntityDoesNotExistException(InventoryRegionEntity.class, regionName);
}

```

The get() method **DOES THROW** the exception as required (I had a breakpoint and verified)!
But my test never catches it. And that is becuase what I get is an 

```
HttpServerErrorException: 500 null

```

And this exception is really being caught by the catch clause.
Why is that happening here?

Thanks!