File tree Expand file tree Collapse file tree 3 files changed +30
-12
lines changed
swagger/swagger-generator/generator-core/src/test/java/org/apache/servicecomb/swagger/generator/core Expand file tree Collapse file tree 3 files changed +30
-12
lines changed Original file line number Diff line number Diff line change 1919
2020import org .apache .servicecomb .swagger .generator .core .model .SwaggerOperation ;
2121import org .apache .servicecomb .swagger .generator .core .model .SwaggerOperations ;
22- import org .junit .jupiter .api .AfterAll ;
22+ import org .junit .jupiter .api .AfterEach ;
2323import org .junit .jupiter .api .Assertions ;
24+ import org .junit .jupiter .api .BeforeEach ;
2425import org .junit .jupiter .api .Test ;
2526
2627import io .swagger .v3 .oas .annotations .headers .Header ;
3132import jakarta .ws .rs .core .MediaType ;
3233
3334public class TestApiResponse {
34- static SwaggerOperations swaggerOperations = SwaggerOperations . generate ( ApiResponseAnnotation . class ) ;
35+ SwaggerOperations swaggerOperations ;
3536
36- @ AfterAll
37- public static void teardown () {
37+ @ BeforeEach
38+ public void setUp () {
39+ swaggerOperations = SwaggerOperations .generate (ApiResponseAnnotation .class );
40+ }
41+
42+ @ AfterEach
43+ public void tearDown () {
3844 swaggerOperations = null ;
3945 }
4046
Original file line number Diff line number Diff line change 2525import org .apache .servicecomb .swagger .generator .core .model .SwaggerOperation ;
2626import org .apache .servicecomb .swagger .generator .core .model .SwaggerOperations ;
2727import org .hamcrest .MatcherAssert ;
28- import org .junit .jupiter .api .AfterAll ;
28+ import org .junit .jupiter .api .AfterEach ;
2929import org .junit .jupiter .api .Assertions ;
30+ import org .junit .jupiter .api .BeforeEach ;
3031import org .junit .jupiter .api .Test ;
3132
3233import io .swagger .v3 .oas .annotations .OpenAPIDefinition ;
4041import io .swagger .v3 .oas .annotations .tags .Tag ;
4142
4243public class TestOperationGenerator {
43- static SwaggerOperations swaggerOperations = SwaggerOperations . generate ( TestClass . class ) ;
44+ SwaggerOperations swaggerOperations ;
4445
45- @ AfterAll
46- public static void teardown () {
46+ @ BeforeEach
47+ public void setUp () {
48+ swaggerOperations = SwaggerOperations .generate (TestClass .class );
49+ }
50+
51+ @ AfterEach
52+ public void tearDown () {
4753 swaggerOperations = null ;
4854 }
4955
Original file line number Diff line number Diff line change 2626import org .apache .servicecomb .swagger .generator .core .model .SwaggerOperations ;
2727import org .hamcrest .MatcherAssert ;
2828import org .hamcrest .Matchers ;
29- import org .junit .jupiter .api .AfterAll ;
29+ import org .junit .jupiter .api .AfterEach ;
3030import org .junit .jupiter .api .Assertions ;
31+ import org .junit .jupiter .api .BeforeEach ;
3132import org .junit .jupiter .api .Test ;
3233
3334import io .swagger .v3 .oas .annotations .Operation ;
4243import jakarta .ws .rs .core .MediaType ;
4344
4445public class OperationMethodAnnotationProcessorTest {
45- static SwaggerOperations swaggerOperations = SwaggerOperations . generate ( TestClass . class ) ;
46+ SwaggerOperations swaggerOperations ;
4647
47- @ AfterAll
48- public static void teardown () {
48+ @ BeforeEach
49+ public void setUp () {
50+ swaggerOperations = SwaggerOperations .generate (TestClass .class );
51+ }
52+
53+ @ AfterEach
54+ public void tearDown () {
4955 swaggerOperations = null ;
5056 }
5157
You can’t perform that action at this time.
0 commit comments