public static RateLimit rndRateLimit() { Ticket ticket = new Ticket(); ticket.setTicketId("1234"); ticket.setComment("My first ticket! Yuppee!"); RateLimit rl = new RateLimit(); rl.setExpirationTime(Calendar.getInstance()); rl.setMaxRequestsPerSecond(rndInt(0, 60)); rl.setTicket(ticket); return rl; }
public static Suspension getLoadBalancerSuspensionDetails( String reason, int ticketId, String user) { Suspension suspension = new Suspension(); Ticket ticket = new Ticket(); ticket.setTicketId("1234"); ticket.setComment("My first ticket! Yuppee!"); suspension.setReason(reason); suspension.setTicket(ticket); suspension.setUser(user); return suspension; }
public static RateLimit getRateLimitDetails(int ticketId, int maxRequestsPerSecond) throws ParseException { RateLimit rl = new RateLimit(); Ticket ticket = new Ticket(); ticket.setTicketId("1234"); ticket.setComment("My first ticket! Yuppee!"); rl.setExpirationTime(Calendar.getInstance()); rl.setMaxRequestsPerSecond(ticketId); rl.setTicket(ticket); return rl; }