Skip to content

Commit c04eba7

Browse files
committed
Polish "Add TestNG support in TestTypeExcludeFilter"
See gh-7630
1 parent b005008 commit c04eba7

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

spring-boot-project/spring-boot-dependencies/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
<statsd-client.version>3.1.0</statsd-client.version>
183183
<sun-mail.version>${javax-mail.version}</sun-mail.version>
184184
<saaj-impl.version>1.5.0</saaj-impl.version>
185-
<testng.version>6.10</testng.version>
186185
<thymeleaf.version>3.0.11.RELEASE</thymeleaf.version>
187186
<thymeleaf-extras-springsecurity.version>3.0.4.RELEASE</thymeleaf-extras-springsecurity.version>
188187
<thymeleaf-layout-dialect.version>2.3.0</thymeleaf-layout-dialect.version>
@@ -2966,11 +2965,6 @@
29662965
<artifactId>nio-multipart-parser</artifactId>
29672966
<version>${nio-multipart-parser.version}</version>
29682967
</dependency>
2969-
<dependency>
2970-
<groupId>org.testng</groupId>
2971-
<artifactId>testng</artifactId>
2972-
<version>${testng.version}</version>
2973-
</dependency>
29742968
<dependency>
29752969
<groupId>org.thymeleaf</groupId>
29762970
<artifactId>thymeleaf</artifactId>

spring-boot-project/spring-boot-parent/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<maven-resolver.version>1.1.1</maven-resolver.version>
2828
<spock.version>1.0-groovy-2.4</spock.version>
2929
<testcontainers.version>1.10.6</testcontainers.version>
30+
<testng.version>6.14.3</testng.version>
3031
<dependency-management-plugin.version>1.0.6.RELEASE</dependency-management-plugin.version>
3132
<spring-doc-resources.version>0.1.0.BUILD-SNAPSHOT</spring-doc-resources.version>
3233
</properties>
@@ -246,6 +247,11 @@
246247
<scope>import</scope>
247248
<type>pom</type>
248249
</dependency>
250+
<dependency>
251+
<groupId>org.testng</groupId>
252+
<artifactId>testng</artifactId>
253+
<version>${testng.version}</version>
254+
</dependency>
249255
<dependency>
250256
<groupId>org.zeroturnaround</groupId>
251257
<artifactId>zt-zip</artifactId>
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,14 +20,8 @@
2020

2121
import org.springframework.context.annotation.Configuration;
2222

23-
/**
24-
* Abstract test with nest {@code @Configuration} and {@code @Test} used by
25-
* {@link TestTypeExcludeFilter}.
26-
*
27-
* @author Eddú Meléndez
28-
*/
2923
@Test
30-
public abstract class AbstractTestNG {
24+
public abstract class AbstractTestNgTestWithConfig {
3125

3226
@Configuration
3327
static class Config {

spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/filter/TestTypeExcludeFilterTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -99,9 +99,10 @@ public void doesNotMatchRegularConfiguration() throws Exception {
9999
}
100100

101101
@Test
102-
public void matchesNestedConfigurationClassWithoutTestngAnnotation()
102+
public void matchesNestedConfigurationClassWithoutTestNgAnnotation()
103103
throws Exception {
104-
assertThat(this.filter.match(getMetadataReader(AbstractTestNG.Config.class),
104+
assertThat(this.filter.match(
105+
getMetadataReader(AbstractTestNgTestWithConfig.Config.class),
105106
this.metadataReaderFactory)).isTrue();
106107
}
107108

0 commit comments

Comments
 (0)