Remove redundant throws declarations from internal APIs
Closes gh-31176
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,7 +37,7 @@ class MyRestClientTests {
|
||||
private MockRestServiceServer server;
|
||||
|
||||
@Test
|
||||
void getVehicleDetailsWhenResultIsSuccessShouldReturnDetails() throws Exception {
|
||||
void getVehicleDetailsWhenResultIsSuccessShouldReturnDetails() {
|
||||
this.server.expect(requestTo("/greet/details")).andRespond(withSuccess("hello", MediaType.TEXT_PLAIN));
|
||||
String greeting = this.service.callRestService();
|
||||
assertThat(greeting).isEqualTo("hello");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,7 +34,7 @@ class MyRepositoryTests {
|
||||
private UserRepository repository;
|
||||
|
||||
@Test
|
||||
void testExample() throws Exception {
|
||||
void testExample() {
|
||||
this.entityManager.persist(new User("sboot", "1234"));
|
||||
User user = this.repository.findByUsername("sboot");
|
||||
assertThat(user.getUsername()).isEqualTo("sboot");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,7 +28,7 @@ public class ExampleEndpoint {
|
||||
|
||||
@PayloadRoot(localPart = "ExampleRequest")
|
||||
@ResponsePayload
|
||||
public Source handleRequest() throws Exception {
|
||||
public Source handleRequest() {
|
||||
return new StringSource("<ExampleResponse>42</ExampleResponse>");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.boot.docs.features.testing.springbootapplications.jmx;
|
||||
|
||||
import javax.management.MBeanServer;
|
||||
import javax.management.MalformedObjectNameException;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -38,7 +37,7 @@ class MyJmxTests {
|
||||
private MBeanServer mBeanServer;
|
||||
|
||||
@Test
|
||||
void exampleTest() throws MalformedObjectNameException {
|
||||
void exampleTest() {
|
||||
assertThat(this.mBeanServer.getDomains()).contains("java.lang");
|
||||
// ...
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,7 +36,7 @@ class MyControllerTests {
|
||||
private UserVehicleService userVehicleService;
|
||||
|
||||
@Test
|
||||
void testExample() throws Exception {
|
||||
void testExample() {
|
||||
// @formatter:off
|
||||
given(this.userVehicleService.getVehicleDetails("sboot"))
|
||||
.willReturn(new VehicleDetails("Honda", "Civic"));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,7 +28,7 @@ class MyTests {
|
||||
private TestRestTemplate template = new TestRestTemplate();
|
||||
|
||||
@Test
|
||||
void testRequest() throws Exception {
|
||||
void testRequest() {
|
||||
ResponseEntity<String> headers = this.template.getForEntity("https://myhost.example.com/example", String.class);
|
||||
assertThat(headers.getHeaders().getLocation()).hasHost("other.example.com");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user