Migrate rest of test suite from JUnit 4 to JUnit Jupiter

This commit migrates the rest of Spring's test suite to JUnit Jupiter,
except spring-test which will be migrated in a separate commit.

See gh-23451
This commit is contained in:
Sam Brannen
2019-08-13 12:57:37 +02:00
parent 3df85c783f
commit 3f3e41923f
1487 changed files with 5428 additions and 4782 deletions

View File

@@ -17,7 +17,7 @@
package org.springframework.context.annotation
import org.junit.Assert.assertNotNull
import org.junit.Test
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.getBean
import org.springframework.context.support.registerBean

View File

@@ -16,16 +16,22 @@
package org.springframework.context.annotation
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.Assert.*
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.getBean
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException
class KotlinConfigurationClassTests {
@Test(expected = BeanDefinitionParsingException::class)
@Test
fun `Final configuration with default proxyBeanMethods value`() {
AnnotationConfigApplicationContext(FinalConfigurationWithProxy::class.java)
try {
AnnotationConfigApplicationContext(FinalConfigurationWithProxy::class.java)
fail("should have thrown a BeanDefinitionParsingException")
}
catch (e: BeanDefinitionParsingException) {
// expected
}
}
@Test

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,10 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.context.annotation
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.BeanFactory
import org.springframework.beans.factory.getBean
import org.springframework.context.support.ClassPathXmlApplicationContext

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
package org.springframework.context.support
import org.junit.Assert.*
import org.junit.Test
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.NoSuchBeanDefinitionException
import org.springframework.beans.factory.getBean
import org.springframework.context.support.BeanDefinitionDsl.*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
package org.springframework.context.support
import org.junit.Assert.assertNotNull
import org.junit.Test
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.getBean
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors
* Copyright 2002-2019 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.ui
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.jupiter.api.Test
/**
* Tests for [Model] Kotlin extensions.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors
* Copyright 2002-2019 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.springframework.ui
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.jupiter.api.Test
/**
* Tests for [ModelMap] Kotlin extensions.