@Test public void processTest() throws AvroRemoteException { RTBRequestWrapper wReq = new RTBRequestWrapper(request); RTBExchange exchange = new RTBExchange("BigAdExchange", "http: List<String> categories = new ArrayList<String>(); categories.add("cat1"); categories.add("cat2"); categories.add("cat3"); Map<String, String> seats = new HashMap<String, String>(); seats.put("BigAdExchange", "1001"); seats.put("SmallAdExchange", "1002"); RTBAdvertiser adv = new RTBAdvertiser("MyPage", "BigBrandIndia", "http: Map<String, RTBAdvertiser> advertisers = new HashMap<String, RTBAdvertiser>(); advertisers.put(adv.getLandingPage(), adv); long reqTimeout = 2000; long offerTimeout = 1000; wReq.setContext(exchange, advertisers, reqTimeout, offerTimeout); BidResponse response = bidder.process(wReq); assertNotNull("Response should not be empty ", response); }
@Override public BidResponse process(BidRequest request) throws AvroRemoteException { BidResponse response = null; if (validateRequest(request)) { RTBRequestWrapper wReq = (RTBRequestWrapper)request; response = new BidResponse(); response.id = wReq.getId(); response.bidid = "simple-bid-tracker"; Map<String, String> seats = wReq.getUnblockedSeats(wReq.getSSPName()); for (Impression i : wReq.getRequest().getImp()) { for (Map.Entry<String, String> s : seats.entrySet()) { RTBAdvertiser a = wReq.getAdvertiser(s.getValue()); SeatBid seat_bid = new SeatBid(); seat_bid.seat = s.getKey(); seat_bid.bid = new ArrayList<Bid>(); Bid b = new Bid(); b.id = "SimpleBid#" + lastBidNum++; b.impid = i.getId(); b.price = i.getBidfloor() + (float) 0.10; b.nurl = a.getNurl(); b.adid = adId; seat_bid.bid.add(b); List<SeatBid> list = new ArrayList<SeatBid>(); list.add(seat_bid); response.setSeatbid(list); } } } return response; }
SimpleBidder implements OpenRTBAPI { @Override public BidResponse process(BidRequest request) throws AvroRemoteException { BidResponse response = null; if (validateRequest(request)) { RTBRequestWrapper wReq = (RTBRequestWrapper)request; response = new BidResponse(); response.id = wReq.getId(); response.bidid = "simple-bid-tracker"; Map<String, String> seats = wReq.getUnblockedSeats(wReq.getSSPName()); for (Impression i : wReq.getRequest().getImp()) { for (Map.Entry<String, String> s : seats.entrySet()) { RTBAdvertiser a = wReq.getAdvertiser(s.getValue()); SeatBid seat_bid = new SeatBid(); seat_bid.seat = s.getKey(); seat_bid.bid = new ArrayList<Bid>(); Bid b = new Bid(); b.id = "SimpleBid#" + lastBidNum++; b.impid = i.getId(); b.price = i.getBidfloor() + (float) 0.10; b.nurl = a.getNurl(); b.adid = adId; seat_bid.bid.add(b); List<SeatBid> list = new ArrayList<SeatBid>(); list.add(seat_bid); response.setSeatbid(list); } } } return response; } }
SimpleBidder implements OpenRTBAPI { @Override public BidResponse process(BidRequest request) throws AvroRemoteException { BidResponse response = null; if (validateRequest(request)) { RTBRequestWrapper wReq = (RTBRequestWrapper)request; response = new BidResponse(); response.id = wReq.getId(); response.bidid = "simple-bid-tracker"; Map<String, String> seats = wReq.getUnblockedSeats(wReq.getSSPName()); for (Impression i : wReq.getRequest().getImp()) { for (Map.Entry<String, String> s : seats.entrySet()) { RTBAdvertiser a = wReq.getAdvertiser(s.getValue()); SeatBid seat_bid = new SeatBid(); seat_bid.seat = s.getKey(); seat_bid.bid = new ArrayList<Bid>(); Bid b = new Bid(); b.id = "SimpleBid#" + lastBidNum++; b.impid = i.getId(); b.price = i.getBidfloor() + (float) 0.10; b.nurl = a.getNurl(); b.adid = adId; seat_bid.bid.add(b); List<SeatBid> list = new ArrayList<SeatBid>(); list.add(seat_bid); response.setSeatbid(list); } } } return response; } SimpleBidder(); }
SimpleBidder implements OpenRTBAPI { @Override public BidResponse process(BidRequest request) throws AvroRemoteException { BidResponse response = null; if (validateRequest(request)) { RTBRequestWrapper wReq = (RTBRequestWrapper)request; response = new BidResponse(); response.id = wReq.getId(); response.bidid = "simple-bid-tracker"; Map<String, String> seats = wReq.getUnblockedSeats(wReq.getSSPName()); for (Impression i : wReq.getRequest().getImp()) { for (Map.Entry<String, String> s : seats.entrySet()) { RTBAdvertiser a = wReq.getAdvertiser(s.getValue()); SeatBid seat_bid = new SeatBid(); seat_bid.seat = s.getKey(); seat_bid.bid = new ArrayList<Bid>(); Bid b = new Bid(); b.id = "SimpleBid#" + lastBidNum++; b.impid = i.getId(); b.price = i.getBidfloor() + (float) 0.10; b.nurl = a.getNurl(); b.adid = adId; seat_bid.bid.add(b); List<SeatBid> list = new ArrayList<SeatBid>(); list.add(seat_bid); response.setSeatbid(list); } } } return response; } SimpleBidder(); @Override BidResponse process(BidRequest request); boolean validateRequest(BidRequest request); }
SimpleBidder implements OpenRTBAPI { @Override public BidResponse process(BidRequest request) throws AvroRemoteException { BidResponse response = null; if (validateRequest(request)) { RTBRequestWrapper wReq = (RTBRequestWrapper)request; response = new BidResponse(); response.id = wReq.getId(); response.bidid = "simple-bid-tracker"; Map<String, String> seats = wReq.getUnblockedSeats(wReq.getSSPName()); for (Impression i : wReq.getRequest().getImp()) { for (Map.Entry<String, String> s : seats.entrySet()) { RTBAdvertiser a = wReq.getAdvertiser(s.getValue()); SeatBid seat_bid = new SeatBid(); seat_bid.seat = s.getKey(); seat_bid.bid = new ArrayList<Bid>(); Bid b = new Bid(); b.id = "SimpleBid#" + lastBidNum++; b.impid = i.getId(); b.price = i.getBidfloor() + (float) 0.10; b.nurl = a.getNurl(); b.adid = adId; seat_bid.bid.add(b); List<SeatBid> list = new ArrayList<SeatBid>(); list.add(seat_bid); response.setSeatbid(list); } } } return response; } SimpleBidder(); @Override BidResponse process(BidRequest request); boolean validateRequest(BidRequest request);  }