|
1 | 1 | /* |
2 | | - * Copyright 2017-2019 the original author or authors. |
| 2 | + * Copyright 2017-2020 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
37 | 37 | * @author Phillip Webb |
38 | 38 | */ |
39 | 39 | public class SpringJUnit5Check extends AbstractSpringCheck { |
| 40 | + |
40 | 41 | private static final String JUNIT4_TEST_ANNOTATION = "org.junit.Test"; |
41 | 42 |
|
42 | | - private static final List<String> TEST_ANNOTATIONS = Collections.unmodifiableList(Arrays.asList( |
43 | | - "RepeatedTest", |
44 | | - "Test", |
45 | | - "TestFactory", |
46 | | - "TestTemplate", |
47 | | - "ParameterizedTest" |
48 | | - )); |
49 | | - |
50 | | - private static final List<String> LIFECYCLE_ANNOTATIONS = Collections.unmodifiableList(Arrays.asList( |
51 | | - "BeforeAll", |
52 | | - "BeforeEach", |
53 | | - "AfterAll", |
54 | | - "AfterEach" |
55 | | - ) |
56 | | - ); |
| 43 | + private static final List<String> TEST_ANNOTATIONS; |
| 44 | + static { |
| 45 | + Set<String> annotations = new LinkedHashSet<>(); |
| 46 | + annotations.add("RepeatedTest"); |
| 47 | + annotations.add("Test"); |
| 48 | + annotations.add("TestFactory"); |
| 49 | + annotations.add("TestTemplate"); |
| 50 | + annotations.add("ParameterizedTest"); |
| 51 | + TEST_ANNOTATIONS = Collections.unmodifiableList(new ArrayList<>(annotations)); |
| 52 | + } |
| 53 | + |
| 54 | + private static final List<String> LIFECYCLE_ANNOTATIONS; |
| 55 | + static { |
| 56 | + Set<String> annotations = new LinkedHashSet<>(); |
| 57 | + annotations.add("BeforeAll"); |
| 58 | + annotations.add("BeforeEach"); |
| 59 | + annotations.add("AfterAll"); |
| 60 | + annotations.add("AfterEach"); |
| 61 | + LIFECYCLE_ANNOTATIONS = Collections.unmodifiableList(new ArrayList<>(annotations)); |
| 62 | + } |
57 | 63 |
|
58 | 64 | private static final Set<String> BANNED_IMPORTS; |
59 | 65 | static { |
|
0 commit comments