Skip to content

Commit 5a5f3fa

Browse files
author
eugenp
committed
changing controller mapping
1 parent b11496c commit 5a5f3fa

6 files changed

Lines changed: 11 additions & 12 deletions

File tree

spring-rest/src/main/java/com/baeldung/produceimage/Application.java renamed to spring-rest/src/main/java/com/baeldung/produceimage/ImageApplication.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
55
import org.springframework.context.annotation.ComponentScan;
6-
import org.springframework.context.annotation.PropertySource;
76

87
@EnableAutoConfiguration
98
@ComponentScan("com.baeldung.produceimage")
10-
public class Application {
9+
public class ImageApplication {
1110
public static void main(final String[] args) {
12-
SpringApplication.run(Application.class, args);
11+
SpringApplication.run(ImageApplication.class, args);
1312
}
1413
}

spring-rest/src/main/java/org/baeldung/config/Application.java renamed to spring-rest/src/main/java/org/baeldung/config/MainApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
@EnableAutoConfiguration
99
@ComponentScan("org.baeldung")
10-
public class Application extends WebMvcConfigurerAdapter {
10+
public class MainApplication extends WebMvcConfigurerAdapter {
1111

1212
public static void main(final String[] args) {
13-
SpringApplication.run(Application.class, args);
13+
SpringApplication.run(MainApplication.class, args);
1414
}
1515

1616
}

‎spring-rest/src/main/java/org/baeldung/web/controller/MyFooController.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
2020

2121
@Controller
22-
@RequestMapping(value = "/myfoos")
22+
@RequestMapping(value = "/foos")
2323
public class MyFooController {
2424

2525
private final Map<Long, Foo> myfoos;

‎spring-rest/src/test/java/org/baeldung/client/RestTemplateBasicLiveTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
public class RestTemplateBasicLiveTest {
3737

3838
private RestTemplate restTemplate;
39-
private static final String fooResourceUrl = "http://localhost:" + APPLICATION_PORT + "/spring-rest/myfoos";
39+
private static final String fooResourceUrl = "http://localhost:" + APPLICATION_PORT + "/spring-rest/foos";
4040

4141
@Before
4242
public void beforeTest() {

‎spring-rest/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class TestRestTemplateBasicLiveTest {
2121

2222
private RestTemplate restTemplate;
23-
private static final String FOO_RESOURCE_URL = "http://localhost:" + APPLICATION_PORT + "/spring-rest/myfoos";
23+
private static final String FOO_RESOURCE_URL = "http://localhost:" + APPLICATION_PORT + "/spring-rest/foos";
2424
private static final String URL_SECURED_BY_AUTHENTICATION = "http://httpbin.org/basic-auth/user/passwd";
2525
private static final String BASE_URL = "http://localhost:" + APPLICATION_PORT + "/spring-rest";
2626

‎spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/SecurityConfig.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
1414
private AuthenticationManager authenticationManager;
1515

1616
@Override
17-
protected void configure(HttpSecurity http) throws Exception {
17+
protected void configure(HttpSecurity http) throws Exception { // @formatter:off
1818
http.requestMatchers()
1919
.antMatchers("/login", "/oauth/authorize")
2020
.and()
@@ -24,15 +24,15 @@ protected void configure(HttpSecurity http) throws Exception {
2424
.and()
2525
.formLogin()
2626
.permitAll();
27-
}
27+
} // @formatter:on
2828

2929
@Override
30-
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
30+
protected void configure(AuthenticationManagerBuilder auth) throws Exception { // @formatter:off
3131
auth.parentAuthenticationManager(authenticationManager)
3232
.inMemoryAuthentication()
3333
.withUser("john")
3434
.password("123")
3535
.roles("USER");
36-
}
36+
} // @formatter:on
3737

3838
}

0 commit comments

Comments
 (0)