diff --git a/src/test/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineServiceTest.java b/src/test/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineServiceTest.java index 2b848db10f..e9b0aded70 100644 --- a/src/test/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineServiceTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/codepipeline/CodePipelineServiceTest.java @@ -78,9 +78,31 @@ class CodePipelineServiceTest { } } + /** + * The guard above is unreachable while the constructor reads only the one key, so this is what + * keeps the message it produces from rotting. {@code enabled()} returns a primitive and is not + * in the answers map, which is exactly the shape that used to fail as "not an interface". + */ + @Test + void configStubNamesAnAccessorItCannotAnswer() { + EmulatorConfig stub = configWithPollInterval(500L); + + IllegalStateException thrown = assertThrows(IllegalStateException.class, + () -> stub.services().codepipeline().enabled()); + + assertTrue(thrown.getMessage().contains("enabled()"), thrown.getMessage()); + assertTrue(thrown.getMessage().contains("answers map"), thrown.getMessage()); + } + /** * Minimal {@link EmulatorConfig} view: the constructor reads only the source poll interval, so * a proxy answering that avoids standing up the Quarkus config container. + * + *
Anything not in the answers map is assumed to be a further config view and is proxied in
+ * turn. That assumption holds only while the constructor reads exactly one key. If a second read
+ * lands and it returns a {@code String} or a primitive there is no interface to proxy, so the
+ * handler says which method it could not answer instead of letting the JDK fail further down
+ * with "not an interface".
*/
private static EmulatorConfig configWithPollInterval(long intervalMs) {
Map