@Test(expected = FlowMapperException.class)
public void testGetFlowMappingWhenExceptionHappens() throws FlowMapperException, IOException, NiFiRegistryException {

    final String agentClass = "Class A";
    when(flowClient.getByBucket(BUCKET_ID)).thenThrow(new NiFiRegistryException("Bucket not found"));
    flowMapper.getFlowMapping(agentClass);
}