/** * Mule Constant Contact Connector * * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ /** * This file was automatically generated by the Mule Development Kit */ package org.mule.modules; import org.junit.Test; //public class ConstantContactConnectorTest extends FunctionalTestCase { public class ConstantContactConnectorTest { // @Override // protected String getConfigResources() { // return "mule-config.xml"; // } @Test public void testGetContacts() throws Exception { // String apiKey = " "; // String username = " "; // String password = " "; // // ConstantContactConnector connector = new ConstantContactConnector(); // connector.setApiKey(apiKey); // connector.connect(username, password); // connector.createMailingList(true, "testlist2", 10); // System.out.println(connector.createCampaign("testCampaign", "unSubject", "fromYo", "");); // connector.createContact("yo@example.com", Arrays.asList("http://api.constantcontact.com/ws/customers/MuleSoft/lists/4"), OptInSource.ACTION_BY_CUSTOMER, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); // System.out.println(connector.getContacts()); // System.out.println(connector.getContactsByEmailAddress(Arrays.asList("chris.melehan@mulesoft.com"))); // System.out.println(connector.getContactsByEmailAddress(Arrays.asList("chris.melehan@mulesoft.com"))); // System.out.println(connector.getContact("2")); // Feed contact = connector.getContact("2"); // String newContent = contact.getEntries().get(0).getContent().replace("<EmailAddress>yo@example.com</EmailAddress>", "<EmailAddress>yo12@example.com</EmailAddress>"); // contact.getEntries().get(0).setContent(newContent, Content.Type.XML); // connector.updateContact(contact); // System.out.println("\n\n\n\n\n" + connector.getContact("2")); // System.out.println(connector.getContactsByListType(new Date(2000 - 1900, 1, 1), ListType.ACTIVE)); // System.out.println(connector.getEvents()); // test get events user muelesoft does not have permissions // System.out.println(connector.getEventRegistrants("1")); // System.out.println(connector.getEventRegistrantGuests("1", "1")); // System.out.println(connector.getMailingListMembers("1")); // System.out.println(connector.getMailingLists()); // Feed mailingList = connector.getMailingList("4"); // connector.updateMailingList(mailingList); // System.out.println(connector.getActivity("a07e5gz5k3dgwnxz4gv")); // System.out.println(connector.getActivities()); // connector.createExportContactsActivity("http://api.constantcontact.com/ws/customers/MuleSoft/lists/3", FileType.CSV, true, true, true, SortBy.DATE_DESC, Arrays.asList(Column.CITY, Column.ADDRESS_LINE_1)); } // @Test // public void testFlow() throws Exception { // runFlowAndExpect("testFlow", "Another string"); // } // // /** // * Run the flow specified by name and assert equality on the expected output // * // * @param flowName The name of the flow to run // * @param expect The expected output // */ // protected <T> void runFlowAndExpect(String flowName, T expect) throws Exception { // Flow flow = lookupFlowConstruct(flowName); // MuleEvent event = AbstractMuleTestCase.getTestEvent(null); // MuleEvent responseEvent = flow.process(event); // // assertEquals(expect, responseEvent.getMessage().getPayload()); // } // // /** // * Run the flow specified by name using the specified payload and assert // * equality on the expected output // * // * @param flowName The name of the flow to run // * @param expect The expected output // * @param payload The payload of the input event // */ // protected <T, U> void runFlowWithPayloadAndExpect(String flowName, T expect, U payload) throws Exception { // Flow flow = lookupFlowConstruct(flowName); // MuleEvent event = AbstractMuleTestCase.getTestEvent(payload); // MuleEvent responseEvent = flow.process(event); // // assertEquals(expect, responseEvent.getMessage().getPayload()); // } // // /** // * Retrieve a flow by name from the registry // * // * @param name Name of the flow to retrieve // */ // protected Flow lookupFlowConstruct(String name) { // return (Flow) AbstractMuleTestCase.muleContext.getRegistry().lookupFlowConstruct(name); // } }