@Test
public void testGetTemplate() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    try {
        Mockito.when(c.getTemplate("template")).thenThrow(new NullPointerException());
        client.getTemplate("template");
        fail();
    } catch (ResourceException ex) {
        assertTrue(true);
    }
    try {
        Mockito.when(c.getTemplate("template2")).thenThrow(new ResourceException(400));
        client.getTemplate("template2");
        fail();
    } catch (ResourceException ex) {
        assertTrue(true);
    }
}