File tree Expand file tree Collapse file tree 3 files changed +32
-26
lines changed
tests/e2e-server/src/test/java/org/glassfish/jersey/tests/e2e/server Expand file tree Collapse file tree 3 files changed +32
-26
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
3
3
*
4
4
* This program and the accompanying materials are made available under the
5
5
* terms of the Eclipse Public License v. 2.0, which is available at
14
14
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
*/
16
16
17
-
18
17
package org .glassfish .jersey .tests .e2e .server ;
19
18
20
- import static org .junit .Assert .assertEquals ;
19
+ import static org .junit .jupiter . api . Assertions .assertEquals ;
21
20
22
21
import javax .ws .rs .GET ;
23
22
import javax .ws .rs .Path ;
26
25
27
26
import org .glassfish .jersey .server .ResourceConfig ;
28
27
import org .glassfish .jersey .test .JerseyTest ;
29
- import org .junit .Test ;
28
+ import org .junit .jupiter . api . Test ;
30
29
31
30
public class Issue4780Resource1Test extends JerseyTest {
32
31
33
32
// 1 interface and 1 implementation having same @Path
34
33
@ Test
35
34
public void resource1 () throws Exception {
36
35
Response response = target ().path ("/resource1" ).request ().get ();
37
- response .bufferEntity ();
38
- assertEquals (response .readEntity (String .class ), 200 , response .getStatus ());
36
+ assertEquals (200 , response .getStatus ());
39
37
}
40
38
41
39
@ Override
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
3
3
*
4
4
* This program and the accompanying materials are made available under the
5
5
* terms of the Eclipse Public License v. 2.0, which is available at
14
14
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
*/
16
16
17
-
18
17
package org .glassfish .jersey .tests .e2e .server ;
19
18
19
+ import static org .junit .jupiter .api .Assertions .assertThrows ;
20
+
20
21
import javax .ws .rs .GET ;
21
22
import javax .ws .rs .Path ;
22
23
23
24
import org .glassfish .jersey .server .ResourceConfig ;
24
25
import org .glassfish .jersey .server .model .ModelValidationException ;
25
26
import org .glassfish .jersey .test .JerseyTest ;
26
- import org .junit .Test ;
27
+ import org .junit .jupiter . api . Test ;
27
28
28
29
public class Issue4780Resource2Test {
29
30
30
31
// 2 interfaces having same @Path
31
- @ Test ( expected = ModelValidationException . class )
32
+ @ Test
32
33
public void resource2 () throws Exception {
33
- JerseyTest test = new JerseyTest (new ResourceConfig (IResource2_1 .class , IResource2_2 .class )) {};
34
- try {
35
- test .setUp ();
36
- } finally {
37
- test .tearDown ();
38
- }
34
+ assertThrows (ModelValidationException .class , () -> {
35
+ JerseyTest test = new JerseyTest (new ResourceConfig (IResource2_1 .class , IResource2_2 .class )) {
36
+ };
37
+ try {
38
+ test .setUp ();
39
+ } finally {
40
+ test .tearDown ();
41
+ }
42
+ });
39
43
}
40
44
41
45
@ Path ("" )
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
3
3
*
4
4
* This program and the accompanying materials are made available under the
5
5
* terms of the Eclipse Public License v. 2.0, which is available at
14
14
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
*/
16
16
17
-
18
17
package org .glassfish .jersey .tests .e2e .server ;
19
18
19
+ import static org .junit .jupiter .api .Assertions .assertThrows ;
20
+
20
21
import javax .ws .rs .GET ;
21
22
import javax .ws .rs .Path ;
22
23
23
24
import org .glassfish .jersey .server .ResourceConfig ;
24
25
import org .glassfish .jersey .server .model .ModelValidationException ;
25
26
import org .glassfish .jersey .test .JerseyTest ;
26
- import org .junit .Test ;
27
+ import org .junit .jupiter . api . Test ;
27
28
28
29
public class Issue4780Resource3Test {
29
30
30
31
// 2 classes having same @Path
31
- @ Test ( expected = ModelValidationException . class )
32
+ @ Test
32
33
public void resource3 () throws Exception {
33
- JerseyTest test = new JerseyTest (new ResourceConfig (Resource3_1 .class , Resource3_2 .class )) {};
34
- try {
35
- test .setUp ();
36
- } finally {
37
- test .tearDown ();
38
- }
34
+ assertThrows (ModelValidationException .class , () -> {
35
+ JerseyTest test = new JerseyTest (new ResourceConfig (Resource3_1 .class , Resource3_2 .class )) {
36
+ };
37
+ try {
38
+ test .setUp ();
39
+ } finally {
40
+ test .tearDown ();
41
+ }
42
+ });
39
43
}
40
44
41
45
@ Path ("" )
You can’t perform that action at this time.
0 commit comments