Similarity scoring, a 5-minute windowed count that alerts once, and a KTable blocklist join, with the Spring wiring on Spring Boot 4.1.1 and Kafka Streams 4.2.1. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RjfyTgmERTWLqzafu34Cth
28 lines
975 B
Java
28 lines
975 B
Java
package com.ankurm.streams;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.context.ApplicationContext;
|
|
import org.springframework.kafka.config.StreamsBuilderFactoryBean;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
/** Proves the Spring wiring: the factory bean exists and holds a topology, without a broker. */
|
|
@SpringBootTest
|
|
class ContextLoadsTest {
|
|
|
|
@Autowired ApplicationContext ctx;
|
|
|
|
@Test
|
|
void streamsFactoryBeanIsWiredAndNotStarted() throws Exception {
|
|
var t = new Transcript("06-spring-context.txt");
|
|
var fb = ctx.getBean(StreamsBuilderFactoryBean.class);
|
|
t.line("StreamsBuilderFactoryBean present: " + (fb != null));
|
|
t.line("auto-startup: " + fb.isAutoStartup());
|
|
t.line("running: " + fb.isRunning());
|
|
t.write();
|
|
assertFalse(fb.isRunning());
|
|
}
|
|
}
|