test_class.declarator: mockMvc
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private MockMvc mockMvc;
test_class.type: MockMvc
test_class.var_name: mockMvc
test_class.declarator: lootTrackerService
test_class.modifier: @MockBean
  	private
test_class.original_string: @MockBean
  	private LootTrackerService lootTrackerService;
test_class.type: LootTrackerService
test_class.var_name: lootTrackerService
test_class.declarator: authFilter
test_class.modifier: @MockBean
  	private
test_class.original_string: @MockBean
  	private AuthFilter authFilter;
test_class.type: AuthFilter
test_class.var_name: authFilter
test_class.declarator: redisPool
test_class.modifier: @MockBean
  	private
test_class.original_string: @MockBean
  	private RedisPool redisPool;
test_class.type: RedisPool
test_class.var_name: redisPool
test_class.file: http-service/src/test/java/net/runelite/http/service/loottracker/LootTrackerControllerTest.java
test_class.identifier: LootTrackerControllerTest
test_case.body: @Test
  	public void storeLootRecord() throws Exception
  	{
  		LootRecord lootRecord = new LootRecord();
  		lootRecord.setType(LootRecordType.NPC);
  		lootRecord.setTime(Instant.now());
  		lootRecord.setDrops(Collections.singletonList(new GameItem(4151, 1)));
  
  		String data = RuneLiteAPI.GSON.toJson(Collections.singletonList(lootRecord));
  		mockMvc.perform(post("/loottracker")
  			.header(RuneLiteAPI.RUNELITE_AUTH, UUID.nameUUIDFromBytes("test".getBytes()))
  			.content(data)
  			.contentType(MediaType.APPLICATION_JSON))
  			.andExpect(status().isOk());
  
  		verify(lootTrackerService).store(eq(Collections.singletonList(lootRecord)), anyInt());
  	}
test_case.class_method_signature: LootTrackerControllerTest.storeLootRecord()
test_case.full_signature: @Test public void storeLootRecord()
test_case.identifier: storeLootRecord
test_case.invocations: setType setTime now setDrops singletonList toJson singletonList andExpect perform contentType content header post nameUUIDFromBytes getBytes isOk status store verify eq singletonList anyInt
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void storeLootRecord()
focal_class.declarator: GSON = RuneLiteAPI.GSON
focal_class.modifier: private static final
focal_class.original_string: private static final Gson GSON = RuneLiteAPI.GSON;
focal_class.type: Gson
focal_class.var_name: GSON
focal_class.declarator: service
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private LootTrackerService service;
focal_class.type: LootTrackerService
focal_class.var_name: service
focal_class.declarator: redisPool
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private RedisPool redisPool;
focal_class.type: RedisPool
focal_class.var_name: redisPool
focal_class.declarator: auth
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private AuthFilter auth;
focal_class.type: AuthFilter
focal_class.var_name: auth
focal_class.file: http-service/src/main/java/net/runelite/http/service/loottracker/LootTrackerController.java
focal_class.identifier: LootTrackerController
focal_class.class_method_signature: LootTrackerController.storeLootRecord(HttpServletRequest request, HttpServletResponse response, @RequestBody Collection<LootRecord> records)
focal_class.full_signature: @RequestMapping(method = RequestMethod.POST) public void storeLootRecord(HttpServletRequest request, HttpServletResponse response, @RequestBody Collection<LootRecord> records)
focal_class.identifier: storeLootRecord
focal_class.modifiers: @RequestMapping(method = RequestMethod.POST) public
focal_class.parameters: (HttpServletRequest request, HttpServletResponse response, @RequestBody Collection<LootRecord> records)
focal_class.return: void
focal_class.signature: void storeLootRecord(HttpServletRequest request, HttpServletResponse response, @RequestBody Collection<LootRecord> records)
focal_class.class_method_signature: LootTrackerController.getLootAggregate(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "count", defaultValue = "1024") int count, @RequestParam(value = "start", defaultValue = "0") int start)
focal_class.full_signature: @GetMapping public Collection<LootAggregate> getLootAggregate(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "count", defaultValue = "1024") int count, @RequestParam(value = "start", defaultValue = "0") int start)
focal_class.identifier: getLootAggregate
focal_class.modifiers: @GetMapping public
focal_class.parameters: (HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "count", defaultValue = "1024") int count, @RequestParam(value = "start", defaultValue = "0") int start)
focal_class.return: Collection<LootAggregate>
focal_class.signature: Collection<LootAggregate> getLootAggregate(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "count", defaultValue = "1024") int count, @RequestParam(value = "start", defaultValue = "0") int start)
focal_class.class_method_signature: LootTrackerController.deleteLoot(HttpServletRequest request, HttpServletResponse response,
  		@RequestParam(required = false) String eventId)
focal_class.full_signature: @DeleteMapping public void deleteLoot(HttpServletRequest request, HttpServletResponse response,
  		@RequestParam(required = false) String eventId)
focal_class.identifier: deleteLoot
focal_class.modifiers: @DeleteMapping public
focal_class.parameters: (HttpServletRequest request, HttpServletResponse response,
  		@RequestParam(required = false) String eventId)
focal_class.return: void
focal_class.signature: void deleteLoot(HttpServletRequest request, HttpServletResponse response,
  		@RequestParam(required = false) String eventId)
focal_method.body: @RequestMapping(method = RequestMethod.POST)
  	public void storeLootRecord(HttpServletRequest request, HttpServletResponse response, @RequestBody Collection<LootRecord> records) throws IOException
  	{
  		SessionEntry session = null;
  		if (request.getHeader(RuneLiteAPI.RUNELITE_AUTH) != null)
  		{
  			session = auth.handle(request, response);
  			if (session == null)
  			{
  				// error is set here on the response, so we shouldn't continue
  				return;
  			}
  		}
  		Integer userId = session == null ? null : session.getUser();
  
  		if (userId != null)
  		{
  			service.store(records, userId);
  		}
  		response.setStatus(HttpStatusCodes.STATUS_CODE_OK);
  
  		try (Jedis jedis = redisPool.getResource())
  		{
  			jedis.publish("drops", GSON.toJson(records));
  		}
  	}
focal_method.class_method_signature: LootTrackerController.storeLootRecord(HttpServletRequest request, HttpServletResponse response, @RequestBody Collection<LootRecord> records)
focal_method.full_signature: @RequestMapping(method = RequestMethod.POST) public void storeLootRecord(HttpServletRequest request, HttpServletResponse response, @RequestBody Collection<LootRecord> records)
focal_method.identifier: storeLootRecord
focal_method.invocations: getHeader handle getUser store setStatus getResource publish toJson
focal_method.modifiers: @RequestMapping(method = RequestMethod.POST) public
focal_method.parameters: (HttpServletRequest request, HttpServletResponse response, @RequestBody Collection<LootRecord> records)
focal_method.return: void
focal_method.signature: void storeLootRecord(HttpServletRequest request, HttpServletResponse response, @RequestBody Collection<LootRecord> records)