@Test
 public void testGetList() {
   BaseMandrillRequest listRequest = new BaseMandrillRequest();
   try {
     templatesRequest.getTemplates(listRequest);
   } catch (RequestFailedException e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }
 @Test
 public void testGetTemplateInfo() {
   MandrillRequestWithName request = new MandrillRequestWithName();
   request.setName("template1");
   try {
     templatesRequest.getTemplateInfo(request);
   } catch (RequestFailedException e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }
  @Test
  public void testUpdateTemplate() {
    MandrillRequestWithCode request = new MandrillRequestWithCode();
    request.setName("template1");
    String newVal = "<html><body>Not template</body></html>";
    request.setCode(newVal);
    MandrillRequestWithName retrieve = new MandrillRequestWithName();
    retrieve.setName("template1");

    try {
      TemplateResponse response = templatesRequest.getTemplateInfo(retrieve);
      String oldVal = response.getCode();
      templatesRequest.updateTemplate(request);
      response = templatesRequest.getTemplateInfo(retrieve);
      assertFalse(oldVal.equals(newVal));
      assertEquals(newVal, response.getCode());
    } catch (RequestFailedException e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
  }
 @Test
 public void testAddTemplate() {
   MandrillRequestWithCode request = new MandrillRequestWithCode();
   request.setCode("<html><body>template</body></html>");
   request.setName("template1");
   try {
     templatesRequest.addTemplate(request);
   } catch (RequestFailedException e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }
 @BeforeClass
 public static void beforeClass() {
   Properties props = new Properties();
   try {
     props.load(TemplatesTest.class.getClassLoader().getResourceAsStream("mandrill.properties"));
   } catch (IOException e) {
     fail("properties file not loaded");
   }
   config.setApiKey(props.getProperty("apiKey"));
   config.setApiVersion("1.0");
   config.setBaseURL("https://mandrillapp.com/api");
   request.setConfig(config);
   request.setObjectMapper(mapper);
   templatesRequest.setRequest(request);
 }