Files
openide/java/java-tests/testSrc/com/intellij/copyright/SPICopyrightTest.kt
Anna Kozlova 6712f4f173 copyright for spi: tolerate whitespaces (IDEA-191665)
GitOrigin-RevId: 18de8ad62ed995b21e20a029a7c8774b2e2db95b
2021-04-06 13:08:16 +00:00

38 lines
1.1 KiB
Kotlin

// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.copyright
import com.intellij.spi.SPIFileType
import com.intellij.testFramework.fixtures.BasePlatformTestCase
import com.maddyhome.idea.copyright.CopyrightProfile
import com.maddyhome.idea.copyright.psi.UpdateCopyrightFactory
class SPICopyrightTest : BasePlatformTestCase() {
fun testSPICopyright() {
myFixture.configureByText(SPIFileType.INSTANCE,
"""
#
# Copyright empty
#
fully.qualified.name
""")
updateCopyright()
myFixture.checkResult("""
#
# Copyright text
#
fully.qualified.name
""")
}
@Throws(Exception::class)
private fun updateCopyright() {
val options = CopyrightProfile()
options.notice = "Copyright text"
options.keyword = "Copyright"
val updateCopyright = UpdateCopyrightFactory.createUpdateCopyright(myFixture.project, myFixture.module,
myFixture.file, options)
updateCopyright!!.prepare()
updateCopyright.complete()
}
}