Test template generated incorrectly in Kotlin

Hi there.

I think there is a problem when Studio generates an integration test stub in Kotlin. Here’s an example:

package com.test.kipper.service

import com.haulmont.cuba.core.global.AppBeans
import com.haulmont.cuba.core.global.DataManager
import com.haulmont.cuba.testsupport.TestContainer
import com.willowparkmedia.kipper.KipperTestContainer
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.RegisterExtension

import org.junit.jupiter.api.Assertions.*

// See https://doc.cuba-platform.com/manual-7.2/integration_tests_mw.html

internal class MyIntegrationTest {

    @Test
    fun myTestMethod() {

    }

    companion object {

        @JvmField
        @RegisterExtension
        var container: TestContainer = KipperTestContainer.Common.INSTANCE
        lateinit var dataManager: DataManager

        @BeforeAll
        fun beforeAll() {
            dataManager = AppBeans.get(DataManager::class.java)
        }
    }
}

The beforeAll method is missing a @JvmStatic annotation. Without it, the beans won’t instantiate properly.

1 Like

Hi, @ray1 !
Thank you for your report.
I created issue in our bug tracker

Thanks.

I can’t access the issue though. Are you using a new bug tracker?

Sorry, I gave you an internal link. this one should work fine

1 Like