Merge branch 'master' into BAEL-5534

This commit is contained in:
Bhaskara
2022-06-06 20:42:25 +05:30
committed by GitHub
370 changed files with 1469 additions and 183 deletions
@@ -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
@@ -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 {
@@ -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()
@@ -14,4 +14,3 @@ public class SecurityTokenApplication {
SpringApplication.run(SecurityTokenApplication.class);
}
}
@@ -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)