Skip to content

Instantly share code, notes, and snippets.

@amolbrid
Created October 13, 2016 17:12
Show Gist options
  • Save amolbrid/5c7124be61d65e54c8b1de4d313010e2 to your computer and use it in GitHub Desktop.
Save amolbrid/5c7124be61d65e54c8b1de4d313010e2 to your computer and use it in GitHub Desktop.
Beeswax session issue
package com.collective.buzz.buzz_it;
import static com.collective.ittests.helpers.IntegrationTestHelper.dateTimeAsString;
import com.collective.pint.adapter.buzz.api.BuzzPartnerServiceLookup;
import com.collective.pint.core.dto.PlatformBasicAuthInfo;
import com.collective.pint.core.dto.PlatformInfo;
import com.collective.pint.core.models.Advertiser;
import com.collective.pint.core.services.AdvertiserPartnerService;
import org.junit.Test;
public class SessionTest {
@Test
public void testSession() {
BuzzPartnerServiceLookup lookup = new BuzzPartnerServiceLookup();
AdvertiserPartnerService advService1 = lookup.getAdvertiserService(getFirstCredentials());
Advertiser advertiser1 = new Advertiser(null, "adv.1." + dateTimeAsString(), true);
System.out.println("adv.1: " + advService1.create(advertiser1));
AdvertiserPartnerService advService2 = lookup.getAdvertiserService(getSecondCredentials());
Advertiser advertiser2 = new Advertiser(null, "adv.2." + dateTimeAsString(), true);
System.out.println("adv.2: " + advService2.create(advertiser2));
AdvertiserPartnerService advService3 = lookup.getAdvertiserService(getFirstCredentials());
Advertiser advertiser3 = new Advertiser(null, "adv.1.1." + dateTimeAsString(), true);
System.out.println("adv.1.1: " + advService3.create(advertiser3));
}
public PlatformInfo getFirstCredentials() {
PlatformInfo platformInfo = new PlatformInfo();
platformInfo.setAuthInfo(new PlatformBasicAuthInfo("visto_api@collective.com", "sz-7h8.BA$1").toPlatformAuthInfo());
platformInfo.setEndPoint("https://collectivesbx.api.beeswax.com");
return platformInfo;
}
public PlatformInfo getSecondCredentials() {
PlatformInfo platformInfo = new PlatformInfo();
platformInfo.setAuthInfo(new PlatformBasicAuthInfo("abrid@collective.com", "Password$1").toPlatformAuthInfo());
platformInfo.setEndPoint("https://collectivesbx.api.beeswax.com");
return platformInfo;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment