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 11/*
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.
33 *
44 * This program and the accompanying materials are made available under the
55 * terms of the Eclipse Public License v. 2.0, which is available at
1414 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515 */
1616
17-
1817package org .glassfish .jersey .tests .e2e .server ;
1918
20- import static org .junit .Assert .assertEquals ;
19+ import static org .junit .jupiter . api . Assertions .assertEquals ;
2120
2221import javax .ws .rs .GET ;
2322import javax .ws .rs .Path ;
2625
2726import org .glassfish .jersey .server .ResourceConfig ;
2827import org .glassfish .jersey .test .JerseyTest ;
29- import org .junit .Test ;
28+ import org .junit .jupiter . api . Test ;
3029
3130public class Issue4780Resource1Test extends JerseyTest {
3231
3332 // 1 interface and 1 implementation having same @Path
3433 @ Test
3534 public void resource1 () throws Exception {
3635 Response response = target ().path ("/resource1" ).request ().get ();
37- response .bufferEntity ();
38- assertEquals (response .readEntity (String .class ), 200 , response .getStatus ());
36+ assertEquals (200 , response .getStatus ());
3937 }
4038
4139 @ Override
Original file line number Diff line number Diff line change 11/*
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.
33 *
44 * This program and the accompanying materials are made available under the
55 * terms of the Eclipse Public License v. 2.0, which is available at
1414 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515 */
1616
17-
1817package org .glassfish .jersey .tests .e2e .server ;
1918
19+ import static org .junit .jupiter .api .Assertions .assertThrows ;
20+
2021import javax .ws .rs .GET ;
2122import javax .ws .rs .Path ;
2223
2324import org .glassfish .jersey .server .ResourceConfig ;
2425import org .glassfish .jersey .server .model .ModelValidationException ;
2526import org .glassfish .jersey .test .JerseyTest ;
26- import org .junit .Test ;
27+ import org .junit .jupiter . api . Test ;
2728
2829public class Issue4780Resource2Test {
2930
3031 // 2 interfaces having same @Path
31- @ Test ( expected = ModelValidationException . class )
32+ @ Test
3233 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+ });
3943 }
4044
4145 @ Path ("" )
Original file line number Diff line number Diff line change 11/*
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.
33 *
44 * This program and the accompanying materials are made available under the
55 * terms of the Eclipse Public License v. 2.0, which is available at
1414 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515 */
1616
17-
1817package org .glassfish .jersey .tests .e2e .server ;
1918
19+ import static org .junit .jupiter .api .Assertions .assertThrows ;
20+
2021import javax .ws .rs .GET ;
2122import javax .ws .rs .Path ;
2223
2324import org .glassfish .jersey .server .ResourceConfig ;
2425import org .glassfish .jersey .server .model .ModelValidationException ;
2526import org .glassfish .jersey .test .JerseyTest ;
26- import org .junit .Test ;
27+ import org .junit .jupiter . api . Test ;
2728
2829public class Issue4780Resource3Test {
2930
3031 // 2 classes having same @Path
31- @ Test ( expected = ModelValidationException . class )
32+ @ Test
3233 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+ });
3943 }
4044
4145 @ Path ("" )
You can’t perform that action at this time.
0 commit comments