refactor: keep kafka clients behind sink mq
This commit is contained in:
@@ -28,10 +28,6 @@
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>protocol-gb32960</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
|
||||
@@ -21,11 +21,31 @@ class EventHistoryPomBoundaryTest {
|
||||
.doesNotContain("com.taosdata.jdbc:taos-jdbcdriver");
|
||||
}
|
||||
|
||||
@Test
|
||||
void kafkaClientsIsOwnedBySinkMqModule() throws Exception {
|
||||
for (Path pom : servicePoms()) {
|
||||
assertThat(directDependencies(readPom(pom)))
|
||||
.as(pom.toString())
|
||||
.doesNotContain("org.apache.kafka:kafka-clients");
|
||||
}
|
||||
}
|
||||
|
||||
private static Document modulePom() throws Exception {
|
||||
return readPom(repositoryRoot().resolve("modules/services/event-history-service/pom.xml"));
|
||||
}
|
||||
|
||||
private static Document readPom(Path pom) throws Exception {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
|
||||
return factory.newDocumentBuilder().parse(Files.newInputStream(repositoryRoot()
|
||||
.resolve("modules/services/event-history-service/pom.xml")));
|
||||
return factory.newDocumentBuilder().parse(Files.newInputStream(pom));
|
||||
}
|
||||
|
||||
private static List<Path> servicePoms() {
|
||||
Path services = repositoryRoot().resolve("modules/services");
|
||||
return List.of(
|
||||
services.resolve("event-history-service/pom.xml"),
|
||||
services.resolve("vehicle-state-service/pom.xml"),
|
||||
services.resolve("vehicle-stat-service/pom.xml"));
|
||||
}
|
||||
|
||||
private static List<String> directDependencies(Document pom) {
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>sink-mq</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
<groupId>com.lingniu.ingest</groupId>
|
||||
<artifactId>sink-mq</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user