Skip to content

Commit

Permalink
Polish contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Mar 2, 2021
1 parent 90de1ab commit 01c2e12
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 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.
Expand Down Expand Up @@ -29,7 +29,6 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
Expand All @@ -38,7 +37,6 @@
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;

Expand Down Expand Up @@ -294,6 +292,7 @@ void maxAgeWithDefaultOrigin(HttpServer httpServer) throws Exception {
assertThat(entity.getHeaders().getAccessControlMaxAge()).isEqualTo(100);
}


@Configuration
@EnableWebFlux
@ComponentScan(resourcePattern = "**/CrossOriginAnnotationIntegrationTests*")
Expand Down Expand Up @@ -415,14 +414,14 @@ public String baz() {
private static class MaxAgeWithDefaultOriginController {

@CrossOrigin
@GetMapping(path = "/classAge")
public String classAge() {
@GetMapping("/classAge")
String classAge() {
return "classAge";
}

@CrossOrigin(maxAge = 100)
@GetMapping(path = "/methodAge")
public String methodAge() {
@GetMapping("/methodAge")
String methodAge() {
return "methodAge";
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 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.
Expand Down Expand Up @@ -59,7 +59,7 @@
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;

/**
* Test fixture for {@link CrossOrigin @CrossOrigin} annotated methods.
* Tests for {@link CrossOrigin @CrossOrigin} annotated methods.
*
* @author Sebastien Deleuze
* @author Sam Brannen
Expand Down Expand Up @@ -516,13 +516,13 @@ public void baz() {
private static class MaxAgeWithDefaultOriginController {

@CrossOrigin
@RequestMapping(path = "/classAge", method = RequestMethod.GET)
public void classAge() {
@GetMapping("/classAge")
void classAge() {
}

@CrossOrigin(maxAge = 100)
@RequestMapping(path = "/methodAge", method = RequestMethod.GET)
public void methodAge() {
@GetMapping("/methodAge")
void methodAge() {
}
}

Expand Down

0 comments on commit 01c2e12

Please sign in to comment.