loottracker: submit loot when not logged in

This is to aid the wiki drop log project. The data is not otherwise
stored.
This commit is contained in:
Adam
2020-10-01 10:03:50 -04:00
parent 32638ccf63
commit 1799c9e593
7 changed files with 54 additions and 27 deletions

View File

@@ -27,6 +27,7 @@ package net.runelite.http.service.loottracker;
import java.io.IOException;
import java.time.Instant;
import java.util.Collections;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.runelite.http.api.RuneLiteAPI;
@@ -91,7 +92,10 @@ public class LootTrackerControllerTest
lootRecord.setDrops(Collections.singletonList(new GameItem(4151, 1)));
String data = RuneLiteAPI.GSON.toJson(Collections.singletonList(lootRecord));
mockMvc.perform(post("/loottracker").content(data).contentType(MediaType.APPLICATION_JSON))
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());