You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 07:26:18 +00:00
fix(housekeeping): align audit log schema
Housekeeping audit writes used an obsolete housekeeping_log schema with operator_id, operator_name, target_user_id and ip columns, while the migration and list composer read actor_id, actor_name, target_type, target_id, target_label, action, detail and success. That made log inserts fail against migrated databases and made auto-created tables unreadable by the client. Align the writer and auto-create DDL with the action-log schema, preserve operator IP in detail, and add a contract test for schema drift.
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
package com.eu.habbo.habbohotel.modtool;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class HousekeepingAuditLogContractTest {
|
||||
private static String auditLogSource() throws Exception {
|
||||
return Files.readString(Path.of("src/main/java/com/eu/habbo/habbohotel/modtool/HousekeepingAuditLog.java"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void writerUsesActionLogSchemaReadByHousekeepingClient() throws Exception {
|
||||
String source = auditLogSource();
|
||||
|
||||
assertTrue(source.contains("actor_id"), "housekeeping_log writer must persist actor_id");
|
||||
assertTrue(source.contains("actor_name"), "housekeeping_log writer must persist actor_name");
|
||||
assertTrue(source.contains("target_type"), "housekeeping_log writer must persist target_type");
|
||||
assertTrue(source.contains("target_id"), "housekeeping_log writer must persist target_id");
|
||||
assertTrue(source.contains("target_label"), "housekeeping_log writer must persist target_label");
|
||||
assertTrue(source.contains("success"), "housekeeping_log writer must persist success");
|
||||
assertFalse(source.contains("operator_id"), "housekeeping_log writer must not use the obsolete operator_id schema");
|
||||
assertFalse(source.contains("target_user_id"), "housekeeping_log writer must not use the obsolete target_user_id schema");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user