From ef2d45ec185420b37c99e4a0d19b5a0600acce0a Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Mon, 30 Oct 2023 11:46:11 +0100 Subject: [PATCH] Correct some type attribution test expectations --- .../java/org/openrewrite/kotlin/KotlinTypeMappingTest.java | 5 ++--- .../openrewrite/kotlin/KotlinTypeSignatureBuilderTest.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/openrewrite/kotlin/KotlinTypeMappingTest.java b/src/test/java/org/openrewrite/kotlin/KotlinTypeMappingTest.java index 07ed6069f..083b48aff 100644 --- a/src/test/java/org/openrewrite/kotlin/KotlinTypeMappingTest.java +++ b/src/test/java/org/openrewrite/kotlin/KotlinTypeMappingTest.java @@ -15,7 +15,6 @@ */ package org.openrewrite.kotlin; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junitpioneer.jupiter.ExpectedToFail; @@ -121,14 +120,14 @@ void fieldType() { assertThat(id.getType().toString()).isEqualTo("kotlin.Int"); JavaType.FullyQualified declaringType = property.getGetter().getMethodType().getDeclaringType(); - assertThat(declaringType.getFullyQualifiedName()).isEqualTo("org.openrewrite.kotlin.KotlinTypeGoatKt"); + assertThat(declaringType.getFullyQualifiedName()).isEqualTo("org.openrewrite.kotlin.KotlinTypeGoat"); assertThat(property.getGetter().getMethodType().getName()).isEqualTo("accessor"); // FIXME assertThat(property.getGetter().getMethodType().getReturnType()).isEqualTo(id.getType()); assertThat(property.getGetter().getName().getType()).isEqualTo(property.getGetter().getMethodType()); assertThat(property.getGetter().getMethodType().toString().substring(declaringType.toString().length())).isEqualTo("{name=accessor,return=kotlin.Int,parameters=[]}"); declaringType = property.getSetter().getMethodType().getDeclaringType(); - assertThat(declaringType.getFullyQualifiedName()).isEqualTo("org.openrewrite.kotlin.KotlinTypeGoatKt"); + assertThat(declaringType.getFullyQualifiedName()).isEqualTo("org.openrewrite.kotlin.KotlinTypeGoat"); assertThat(property.getSetter().getMethodType().getName()).isEqualTo("accessor"); // FIXME assertThat(property.getSetter().getMethodType()).isEqualTo(property.getSetter().getName().getType()); assertThat(property.getSetter().getMethodType().toString().substring(declaringType.toString().length())).isEqualTo("{name=accessor,return=kotlin.Unit,parameters=[kotlin.Int]}"); diff --git a/src/test/java/org/openrewrite/kotlin/KotlinTypeSignatureBuilderTest.java b/src/test/java/org/openrewrite/kotlin/KotlinTypeSignatureBuilderTest.java index e1f8724fd..b71db0812 100644 --- a/src/test/java/org/openrewrite/kotlin/KotlinTypeSignatureBuilderTest.java +++ b/src/test/java/org/openrewrite/kotlin/KotlinTypeSignatureBuilderTest.java @@ -173,7 +173,7 @@ void fileField() { .filter(it -> it instanceof FirProperty && "field".equals(((FirProperty) it).getName().asString())) .map(it -> (FirProperty) it).findFirst().orElseThrow(); assertThat(signatureBuilder().variableSignature(firProperty.getSymbol(), getCompiledSource().getSymbol())) - .isEqualTo("KotlinTypeGoatKt{name=field,type=kotlin.Int}"); + .isEqualTo("org.openrewrite.kotlin.KotlinTypeGoatKt{name=field,type=kotlin.Int}"); } @Test @@ -182,7 +182,7 @@ void fileFunction() { .filter(it -> it instanceof FirSimpleFunction && "function".equals(((FirSimpleFunction) it).getName().asString())) .map(it -> (FirSimpleFunction) it).findFirst().orElseThrow(); assertThat(signatureBuilder().methodDeclarationSignature(function.getSymbol(), getCompiledSource().getSymbol())) - .isEqualTo("KotlinTypeGoatKt{name=function,return=kotlin.Unit,parameters=[org.openrewrite.kotlin.C]}"); + .isEqualTo("org.openrewrite.kotlin.KotlinTypeGoatKt{name=function,return=kotlin.Unit,parameters=[org.openrewrite.kotlin.C]}"); } @Test