Merge branch 'master' into BAEL-5534
This commit is contained in:
@@ -14,6 +14,7 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
|
||||
- [Spring Boot and Caffeine Cache](https://www.baeldung.com/spring-boot-caffeine-cache)
|
||||
- [Spring Boot and Togglz Aspect](https://www.baeldung.com/spring-togglz)
|
||||
- [Getting Started with GraphQL and Spring Boot](https://www.baeldung.com/spring-graphql)
|
||||
- [Expose GraphQL Field with Different Name](https://www.baeldung.com/expose-graphql-field-with-different-name)
|
||||
- More articles: [[next -->]](/spring-boot-modules/spring-boot-libraries-2)
|
||||
|
||||
### GraphQL sample queries
|
||||
|
||||
+5
@@ -12,4 +12,9 @@ public class PostResolver implements GraphQLResolver<Post> {
|
||||
public Author getAuthor(Post post) {
|
||||
return authorDao.getAuthor(post.getAuthorId()).orElseThrow(RuntimeException::new);
|
||||
}
|
||||
|
||||
public Author getFirst_author(Post post) {
|
||||
return authorDao.getAuthor(post.getAuthorId()).orElseThrow(RuntimeException::new);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ type Post {
|
||||
text: String!
|
||||
category: String
|
||||
author: Author!
|
||||
first_author: Author!
|
||||
}
|
||||
|
||||
type Author {
|
||||
|
||||
+1
@@ -52,6 +52,7 @@ public class SecurityConfiguration {
|
||||
//@formatter:off
|
||||
return http
|
||||
.authorizeHttpRequests(authorizeRequests -> authorizeRequests
|
||||
|
||||
.antMatchers("/api/auth/**", "/swagger-ui-custom.html" ,"/swagger-ui.html", "/swagger-ui/**", "/v3/api-docs/**", "/webjars/**",
|
||||
"/swagger-ui/index.html","/api-docs/**")
|
||||
.permitAll()
|
||||
|
||||
-1
@@ -14,4 +14,3 @@ public class SecurityTokenApplication {
|
||||
SpringApplication.run(SecurityTokenApplication.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-6
@@ -43,8 +43,7 @@ class OpenApiJwtIntegrationTest
|
||||
{
|
||||
assertNotNull(authenticationApi);
|
||||
|
||||
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/api-docs",
|
||||
String.class);
|
||||
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/api-docs", String.class);
|
||||
|
||||
assertNotNull(response);
|
||||
assertEquals(HttpStatus.OK, response.getStatusCode());
|
||||
@@ -59,8 +58,8 @@ class OpenApiJwtIntegrationTest
|
||||
{
|
||||
assertNotNull(authenticationApi);
|
||||
|
||||
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/api-docs",
|
||||
String.class);
|
||||
|
||||
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/api-docs", String.class);
|
||||
|
||||
assertNotNull(response);
|
||||
assertNotNull(response.getBody());
|
||||
@@ -75,8 +74,7 @@ class OpenApiJwtIntegrationTest
|
||||
{
|
||||
assertNotNull(authenticationApi);
|
||||
|
||||
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/api-docs",
|
||||
String.class);
|
||||
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/api-docs", String.class);
|
||||
|
||||
assertNotNull(response);
|
||||
assertNotNull(response.getBody());
|
||||
|
||||
@@ -10,4 +10,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
|
||||
|
||||
- [Setting the Log Level in Spring Boot when Testing](https://www.baeldung.com/spring-boot-testing-log-level)
|
||||
- [Failed to Load ApplicationContext for JUnit Test of Spring Controller](https://www.baeldung.com/spring-junit-failed-to-load-applicationcontext)
|
||||
- [Spring Web Service Integration Tests with @WebServiceServerTest](https://www.baeldung.com/spring-webserviceservertest)
|
||||
- More articles: [[<-- prev]](../spring-boot-testing)
|
||||
|
||||
Reference in New Issue
Block a user