@Test
public void testWorkflowDeleteThrowException() {

    MetadataClient mockClient = Mockito.mock(MetadataClient.class);
    expectedException.expect(RuntimeException.class);
    expectedException.expectMessage("Invalid Workflow name");
    doThrow(new RuntimeException("Invalid Workflow name")).when(mockClient).unregisterWorkflowDef(anyString(), any());
    mockClient.unregisterWorkflowDef("hello", 1);
}