Examples of MandrillTemplate


Examples of com.microtripit.mandrillapp.lutung.view.MandrillTemplate

    Assert.fail();
  }
 
  @Test
  public final void testAdd() throws IOException, MandrillApiError {
    final MandrillTemplate t = mandrillApi.templates().add(templateName,
        "<html><body><h1>Hello World!</h1></body></html>", false);
    Assert.assertNotNull(t);
    Assert.assertNotNull(t.getName());
    Assert.assertNotNull( mandrillApi.templates().delete(t.getName()) );
  }
View Full Code Here

Examples of com.microtripit.mandrillapp.lutung.view.MandrillTemplate

  @Test
  public final void testInfo() throws IOException, MandrillApiError {
    final MandrillTemplate[] templates = mandrillApi.templates().list();
    Assert.assertNotNull(templates);
    if(templates.length > 0) {
      final MandrillTemplate t =
          mandrillApi.templates().info(templates[0].getName());
      Assert.assertNotNull(t);
      Assert.assertNotNull(t.getName());
      Assert.assertNotNull(t.getCode());
      Assert.assertNotNull(t.getCreatedAt());
    }
  }
View Full Code Here

Examples of com.microtripit.mandrillapp.lutung.view.MandrillTemplate

    Assert.fail();
  }
 
  @Test
  public final void testUpdate() throws IOException, MandrillApiError {
    MandrillTemplate t = mandrillApi.templates().add(templateName,
        "<html><body><h1>Hello World!</h1></body></html>", false);
    Assert.assertNotNull(t);
    final String updatedCode = "<html><body><h1>Hello World! UPDATED</h1></body></html>";
    t = mandrillApi.templates().update(t.getName(), updatedCode, false);
    Assert.assertNotNull(t);
    Assert.assertNotNull(t.getName());
    Assert.assertEquals(updatedCode, t.getCode());
    Assert.assertNotNull(t.getCreatedAt());
    Assert.assertNotNull( mandrillApi.templates().delete(t.getName()) );
  }
View Full Code Here

Examples of com.microtripit.mandrillapp.lutung.view.MandrillTemplate

    Assert.fail();
  }
 
  @Test
  public final void testPublish() throws IOException, MandrillApiError {
    MandrillTemplate t = mandrillApi.templates().add(
        templateName,
        "<html><body><h1>Hello World!</h1></body></html>",
        false);
    Assert.assertNotNull(t);
    Assert.assertNull(t.getPublishedAt());
    t = mandrillApi.templates().publish(t.getName());
    Assert.assertNotNull(t);
    Assert.assertNotNull(t.getPublishedAt());
    Assert.assertNotNull( mandrillApi.templates().delete(t.getName()) );
  }
View Full Code Here

Examples of com.microtripit.mandrillapp.lutung.view.MandrillTemplate

    Assert.fail();
  }
 
  @Test
  public final void testDelete() throws IOException, MandrillApiError {
    MandrillTemplate t = mandrillApi.templates().add(
        templateName,
        "<html><body><h1>Hello World!</h1></body></html>",
        false);
    Assert.assertNotNull(t);
    t = mandrillApi.templates().delete(t.getName());
    Assert.assertNotNull(t);
  }
View Full Code Here

Examples of com.microtripit.mandrillapp.lutung.view.MandrillTemplate

  }
 
  @Test
  public final void testRender() throws IOException, MandrillApiError {
    final String code = "<html><body><h1>Hello *|MERGE1|*!</h1></body></html>";
    MandrillTemplate t = mandrillApi.templates().add(templateName,
        code, false);
    Assert.assertNotNull(t);
    final HashMap<String, String> content = new HashMap<String,String>();
    content.put("editable", "<div>foo *|MERGE2|*</div>");
    final HashMap<String, String> mergeVars = new HashMap<String, String>();
    mergeVars.put("merge1", "Lutung");
    mergeVars.put("merge2", "bar");
    final String rendered = mandrillApi.templates().render(
        t.getName(), content, mergeVars);
    Assert.assertNotNull(rendered);
    Assert.assertEquals(code.replace("*|MERGE1|*", "Lutung"), rendered);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.