Search in sources :

Example 1 with FraudLog

use of com.xrtb.fraud.FraudLog in project XRTB by benmfaul.

the class TestFraud method testMMDBGood.

//  @Test
public void testMMDBGood() throws Exception {
    MMDBClient forensiq = MMDBClient.build("local/GeoIP2-ISP.mmdb");
    String rt = "display";
    String ip = "123.254.33.4";
    String url = "http%3A%2F%2Fwww.myheretrtrtouse.com%2Fsections%2Fliving%3Fa%3D3%20";
    String ua = "erererer%2F4.0%20(compatible%3B%20MSIE%207.0%3B%20Windoreererws%20NT%206.0)";
    String seller = "seller1234";
    String crid = "xyz1234";
    FraudLog m = forensiq.bid(rt, ip, url, ua, seller, crid);
    assertNull(m);
    List<String> test = new ArrayList();
    test.add("st");
    forensiq.setWatchlist(test);
    m = forensiq.bid(rt, ip, url, ua, seller, crid);
    m.exchange = "smaato";
    m.id = "32092930293020020";
    System.out.println(m);
    assertNotNull(m);
}
Also used : MMDBClient(com.xrtb.fraud.MMDBClient) ArrayList(java.util.ArrayList) FraudLog(com.xrtb.fraud.FraudLog)

Example 2 with FraudLog

use of com.xrtb.fraud.FraudLog in project XRTB by benmfaul.

the class TestFraud method testBad.

/**
	   * Test a valid bid response.
	   * @throws Exception on networking errors.
	   */
// @Test 
public void testBad() throws Exception {
    ForensiqClient forensiq = ForensiqClient.build("6RLzOXoxntkqr0PHJ1Z0");
    String rt = "display";
    // device.ip
    String ip = "52.35.123.110";
    // site.page
    String url = "http%3A%2F%2Fwww.myheretrtrtouse.com%2Fsections%2Fliving%3Fa%3D3%20";
    // device.ua
    String ua = "erererer%2F4.0%20(compatible%3B%20MSIE%207.0%3B%20Windoreererws%20NT%206.0";
    // site.name		
    String seller = "seller1234";
    // your creative id
    String crid = "creative1234";
    FraudLog m = forensiq.bid(rt, ip, url, ua, seller, crid);
    assertNotNull(m);
}
Also used : FraudLog(com.xrtb.fraud.FraudLog) ForensiqClient(com.xrtb.fraud.ForensiqClient)

Example 3 with FraudLog

use of com.xrtb.fraud.FraudLog in project XRTB by benmfaul.

the class TestFraud method testGood.

/**
	   * Test a valid bid response.
	   * @throws Exception on networking errors.
	   */
//@Test 
public void testGood() throws Exception {
    ForensiqClient forensiq = ForensiqClient.build("YOUR KEY HERE");
    String rt = "display";
    String ip = "123.250.33.4";
    String url = "http%3A%2F%2Fwww.myheretrtrtouse.com%2Fsections%2Fliving%3Fa%3D3%20";
    String ua = "erererer%2F4.0%20(compatible%3B%20MSIE%207.0%3B%20Windoreererws%20NT%206.0)";
    String seller = "seller1234";
    String crid = "xyz1234";
    FraudLog m = forensiq.bid(rt, ip, url, ua, seller, crid);
    assertNull(m);
}
Also used : FraudLog(com.xrtb.fraud.FraudLog) ForensiqClient(com.xrtb.fraud.ForensiqClient)

Example 4 with FraudLog

use of com.xrtb.fraud.FraudLog in project XRTB by benmfaul.

the class TestFraud method testARealBid.

//@Test 
public void testARealBid() throws Exception {
    ForensiqClient forensiq = ForensiqClient.build("YOUR_KEY_HERE");
    String s = Charset.defaultCharset().decode(ByteBuffer.wrap(Files.readAllBytes(Paths.get("./SampleBids/nexage.txt")))).toString();
    String rt = "display";
    String ip = "123.254.33.4";
    String url = "http%3A%2F%2Fwww.myheretrtrtouse.com%2Fsections%2Fliving%3Fa%3D3%20";
    String ua = "erererer%2F4.0%20(compatible%3B%20MSIE%207.0%3B%20Windoreererws%20NT%206.0)";
    String seller = "seller1234";
    String crid = "xyz1234";
    FraudLog m = forensiq.bid(rt, ip, url, ua, seller, crid);
    assertNull(m);
}
Also used : FraudLog(com.xrtb.fraud.FraudLog) ForensiqClient(com.xrtb.fraud.ForensiqClient)

Aggregations

FraudLog (com.xrtb.fraud.FraudLog)4 ForensiqClient (com.xrtb.fraud.ForensiqClient)3 MMDBClient (com.xrtb.fraud.MMDBClient)1 ArrayList (java.util.ArrayList)1