Skip to content

Commit 2d0f7e0

Browse files
committed
Fixed tests
1 parent 4b37a2d commit 2d0f7e0

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

kora-app-annotation-processor/src/test/java/ru/tinkoff/kora/kora/app/annotation/processor/KoraAppProcessorTest.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void unresolvedDependency() {
171171
void testCircularDependency() {
172172
assertThatThrownBy(() -> testClass(AppWithCircularDependency.class))
173173
.isInstanceOfSatisfying(CompilationErrorException.class, e -> SoftAssertions.assertSoftly(s -> {
174-
s.assertThat(e.getMessage()).startsWith("There's a cycle in graph: ");
174+
s.assertThat(e.getMessage()).startsWith("Encountered circular dependency in graph for source type:");
175175
s.assertThat(e.diagnostics.get(0).getSource().getName()).isEqualTo("src/test/java/ru/tinkoff/kora/kora/app/annotation/processor/app/AppWithCircularDependency.java");
176176
}));
177177
}
@@ -194,7 +194,7 @@ void appWithFactory() throws Throwable {
194194
// testClass(AppWithFactories5.class).init();; TODO больше не нужно
195195
assertThatThrownBy(() -> testClass(AppWithFactories6.class))
196196
.isInstanceOf(CompilationErrorException.class)
197-
.hasMessageStartingWith("There's a cycle in graph:");
197+
.hasMessageStartingWith("Encountered circular dependency in graph for source type");
198198
testClass(AppWithFactories7.class).init();
199199
testClass(AppWithFactories8.class).init();
200200
testClass(AppWithFactories9.class).init();
@@ -261,11 +261,7 @@ void appWithComponentDescriptorCollisionAndDirect() {
261261
.isInstanceOfSatisfying(CompilationErrorException.class, e -> SoftAssertions.assertSoftly(s -> {
262262
var error = e.getDiagnostics().stream().filter(d -> d.getKind() == Diagnostic.Kind.ERROR).findFirst().get();
263263
s.assertThat(error.getMessage(Locale.US))
264-
.startsWith("More than one component matches dependency claim ru.tinkoff.kora.kora.app.annotation.processor.app.AppWithComponentCollisionAndDirect.Class1:");
265-
266-
s.assertThat(error.getMessage(Locale.US)).contains("FromModuleComponent[type=ru.tinkoff.kora.kora.app.annotation.processor.app.AppWithComponentCollisionAndDirect.Class1, module=MixedInModule[element=ru.tinkoff.kora.kora.app.annotation.processor.app.AppWithComponentCollisionAndDirect], method=c1()");
267-
s.assertThat(error.getMessage(Locale.US)).contains("FromModuleComponent[type=ru.tinkoff.kora.kora.app.annotation.processor.app.AppWithComponentCollisionAndDirect.Class1, module=MixedInModule[element=ru.tinkoff.kora.kora.app.annotation.processor.app.AppWithComponentCollisionAndDirect], method=c2()");
268-
s.assertThat(error.getMessage(Locale.US)).contains("FromModuleComponent[type=ru.tinkoff.kora.kora.app.annotation.processor.app.AppWithComponentCollisionAndDirect.Class1, module=MixedInModule[element=ru.tinkoff.kora.kora.app.annotation.processor.app.AppWithComponentCollisionAndDirect], method=c3()");
264+
.startsWith("More than one component matches dependency type: ru.tinkoff.kora.kora.app.annotation.processor.app.AppWithComponentCollisionAndDirect.Class1");
269265
}));
270266
}
271267

kora-app-symbol-processor/src/test/kotlin/ru/tinkoff/kora/kora/app/ksp/KoraAppKspTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class KoraAppKspTest {
219219
Assertions.assertThatThrownBy { testClass(AppWithCircularDependency::class) }
220220
.isInstanceOfSatisfying(CompilationErrorException::class.java) { e ->
221221
SoftAssertions.assertSoftly { s: SoftAssertions ->
222-
s.assertThat(e.messages).anyMatch { it.contains("There's a cycle in graph: ") }
222+
s.assertThat(e.messages).anyMatch { it.contains("Encountered circular dependency in graph for source type") }
223223
}
224224
}
225225
}
@@ -247,7 +247,7 @@ class KoraAppKspTest {
247247
Assertions.assertThatThrownBy { testClass(AppWithFactories6::class) }
248248
.isInstanceOfSatisfying(CompilationErrorException::class.java) { e ->
249249
SoftAssertions.assertSoftly { s: SoftAssertions ->
250-
s.assertThat(e.messages).anyMatch { it.contains("There's a cycle in graph: ") }
250+
s.assertThat(e.messages).anyMatch { it.contains("Encountered circular dependency in graph for source type") }
251251
}
252252
}
253253

@@ -308,7 +308,7 @@ class KoraAppKspTest {
308308
.isInstanceOfSatisfying(CompilationErrorException::class.java) { e ->
309309
SoftAssertions.assertSoftly { s: SoftAssertions ->
310310
s.assertThat(e.messages)
311-
.anyMatch { it.contains("More than one component matches dependency claim ru.tinkoff.kora.kora.app.ksp.app.AppWithComponentCollisionAndDirect.Class1 tag=[]:") }
311+
.anyMatch { it.contains("More than one component matches dependency type: ru.tinkoff.kora.kora.app.ksp.app.AppWithComponentCollisionAndDirect.Class1") }
312312
}
313313
}
314314
}

0 commit comments

Comments
 (0)