fleetd #743: drop the redundant source-scrape test for attributeIfObserver
FleetMcpObserverSendDeliveryTest already kills the same mutation end to end (it asserts the exact attributed text herdr receives), and the code quality rule in CLAUDE.md caps new source-text tests in this file at the existing count.
This commit is contained in:
@@ -473,35 +473,6 @@ class FleetMcpAuthzTest {
|
||||
+ "calling, not pass a literal boolean -- block: " + handlerBlock);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code attributeIfObserver} can be correct in isolation while the one production call site
|
||||
* never asks it -- a {@code str(a, "content")} left unwrapped would compile and every other
|
||||
* test here would still pass. This reads {@code FleetMcp.java}'s own source and asserts the
|
||||
* {@code fleet_send} handler's {@code content} assignment passes through
|
||||
* {@code attributeIfObserver(caller, ...)}, not the raw argument.
|
||||
*/
|
||||
@Test
|
||||
void theSendHandlerActuallyAttributesAnObserversContent() throws Exception {
|
||||
String source = Files.readString(MCP_SOURCE);
|
||||
|
||||
int start = source.indexOf("sendHandler =");
|
||||
assertTrue(start >= 0, "could not find the fleet_send handler (sendHandler) in " + MCP_SOURCE
|
||||
+ " -- the scrape has stopped matching, fix the anchor before trusting this test");
|
||||
int end = source.indexOf("replyHandler =", start);
|
||||
assertTrue(end > start, "could not find the handler declared after sendHandler to bound the scrape");
|
||||
String handlerBlock = source.substring(start, end);
|
||||
|
||||
// CONTROL: the block we scraped really does assign "content" from the request -- if this
|
||||
// fails, the anchors above moved and the assertion below would otherwise pass on nothing.
|
||||
assertTrue(handlerBlock.contains("str(a, \"content\")"),
|
||||
"control failed: the scraped sendHandler block contains no content extraction at all -- "
|
||||
+ "the anchors have drifted, this test is not testing what it claims to");
|
||||
|
||||
assertTrue(handlerBlock.contains("attributeIfObserver(caller, str(a, \"content\"))"),
|
||||
"the fleet_send handler must assign content from attributeIfObserver(caller, ...), "
|
||||
+ "not the raw request argument -- block: " + handlerBlock);
|
||||
}
|
||||
|
||||
// --- who may see fleet_list's leads and members arrays ---------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user