Examples of SFHandler


Examples of co.nubetech.hiho.common.sf.SFHandler

public class TestExportSalesforceMapper {
 
  @Test
  public final void testMapperForNullValues() throws IOException, InterruptedException, ConnectionException, AsyncApiException {
    Mapper.Context context = mock(Mapper.Context.class);
    SFHandler mockSFHandler = mock(SFHandler.class);
    when(mockSFHandler.getBulkConnection(anyString(), anyString())).thenReturn(null);
    BatchInfo batchInfo = new BatchInfo();
    String id = "id";
    batchInfo.setId(id);
    when(mockSFHandler.createBatch(any(FSDataInputStream.class), any(BulkConnection.class), any(JobInfo.class))).thenReturn(
        batchInfo);
    ExportSalesforceMapper mapper = new ExportSalesforceMapper();
    mapper.setSfHandler(mockSFHandler);
    Text batchId = new Text(id);
    mapper.setBatchId(batchId);
View Full Code Here

Examples of co.nubetech.hiho.common.sf.SFHandler

    conf.set(HIHOConf.SALESFORCE_USERNAME, user);
    conf.set(HIHOConf.SALESFORCE_PASSWORD, password);
    conf.set(HIHOConf.SALESFORCE_SOBJECTYPE, sObject);
    when(context.getConfiguration()).thenReturn(conf);
   
    SFHandler mockSFHandler = mock(SFHandler.class);
    when(mockSFHandler.getBulkConnection(user, password)).thenReturn(null);
   
    JobInfo info = new JobInfo();
    String id = "id";
    info.setId(id);
    when(mockSFHandler.createJob(sObject, null)).thenReturn(info);
   
    ExportSalesforceMapper mapper = new ExportSalesforceMapper();
    mapper.setSfHandler(mockSFHandler);
    mapper.setup(context);
    verify(context, times(3)).getConfiguration()
View Full Code Here

Examples of co.nubetech.hiho.common.sf.SFHandler

  @Test
  public final void testMapper() throws IOException, InterruptedException, ConnectionException, AsyncApiException {
    ExportSalesforceMapper mapper = new ExportSalesforceMapper();
    BulkConnection conn = mock(BulkConnection.class);
    SFHandler mockSFHandler = mock(SFHandler.class);
    mapper.setConnection(conn);
    mapper.setSfHandler(mockSFHandler);
   
    Mapper.Context context = mock(Mapper.Context.class);
    BatchInfo batchInfo = new BatchInfo();
    String id = "id";
    batchInfo.setId(id);
    Text batchId = new Text();
    mapper.setBatchId(batchId);   
   
    JobInfo info = new JobInfo();
    String id1 = "id1";
    info.setId(id1);
    when(mockSFHandler.createBatch(any(FSDataInputStream.class), any(BulkConnection.class), any(JobInfo.class))).thenReturn(
        batchInfo);
    mapper.setSfHandler(mockSFHandler);
    mapper.setJob(info);
    mapper.setJobId(new Text(id1));
    mapper.map(new Text("abc"), mock(FSDataInputStream.class), context);
View Full Code Here

Examples of co.nubetech.hiho.common.sf.SFHandler

          HIHOConf.SALESFORCE_SOBJECTYPE);
      logger.debug("Salesforce connection values are " + username + "/"
          + password + " and sObject is " + sfObject);
      conn = sfHandler.getBulkConnection(username, password);
      batchResultText = new Text();
      sfHandler = new SFHandler();
    } catch (Exception e) {
      e.printStackTrace();
      throw new IOException(e);
    }
  }
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.