.
├── com
│ ├── vicky
MySQL Local Setup in MAC
brew install mysql
mysql
$(brew --prefix mysql)/bin/mysqladmin -u root password root
mysql -h localhost -P 3306 -u root -p (Enter password as root to login)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version : '3' | |
services: | |
mysql: | |
image: mysql | |
command: --default-authentication-plugin=mysql_native_password | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- "3306:3306" | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-maven-plugin</artifactId> | |
</plugin> | |
<plugin> | |
<artifactId>maven-clean-plugin</artifactId> | |
<version>2.5</version> | |
<configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.boot.test.mock.mockito.MockBean; | |
import org.springframework.security.test.context.support.WithMockUser; | |
import org.springframework.test.web.servlet.MockMvc; | |
import org.springframework.test.web.servlet.setup.MockMvcBuilders; | |
import org.springframework.web.context.WebApplicationContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JsonFilter("userFilter") | |
public class User { | |
private Integer id; | |
private String name; | |
private Date dob; | |
private String city; | |
// constructors, getters & setters are ignored | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class User { | |
private Integer id; | |
private String name; | |
private Date dob; | |
private String city; | |
// constructors, getters & setters are ignored | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to ignore fields in Java Object while serializing | |
// Approach 1 - @JsonIgnoreProperties | |
@JsonIgnoreProperties(value = {"id", "dob"}) | |
public class User { | |
private Integer id; | |
private String name; | |
private Date dob; |
NewerOlder