Create new test: Ctrl + Shift + t
Security:
https://amigoscode.com/courses/728126/lectures/13124158
https://www.youtube.com/watch?v=KxqlJblhzfI
https://www.youtube.com/watch?v=b9O9NI-RJ3o
Dan Vega:
https://www.youtube.com/playlist?list=PLZV0a2jwt22s5NCKOwSmHVagoDW8nflaC
ObjectMapper:
https://fasterxml.github.io/jackson-databind/javadoc/2.7/com/fasterxml/jackson/databind/ObjectMapper.html
https://www.baeldung.com/jackson-object-mapper-tutorial
https://link.springer.com/book/10.1007/978-1-4842-3676-5
JAVA DTO Pattern Tutorial https://www.youtube.com/watch?v=5yquJa2x3Ko&t=193s
RuntimeException:
@ResponseStatus(HttpStatus.NOT_FOUND)
public class TestRuntimeException extends RuntimeException{
public TestRuntimeException(String id_not_found) {
}
}
String to JSON: https://github.com/amigoscode/java-streams/blob/main/src/test/java/com/amigoscode/mockdata/MockData.java
public static List<Person> getPeople() throws IOException {
InputStream inputStream = Resources.getResource("people.json").openStream();
String json = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
Type listType = new TypeToken<ArrayList<Person>>() {
}.getType();
return new Gson().fromJson(json, listType);
}
spring-data-jpa-course: https://github.com/amigoscode/spring-data-jpa-course/blob/section-7/src/main/resources/application.properties
spring.datasource.url=jdbc:postgresql://localhost:5432/amigoscode
spring.datasource.username=
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.format_sql=true
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
server.error.include-message=always
server.error.include-binding-errors=always
spring:
h2.console.enabled: true
datasource:
url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
username: sa
password:
driver-class-name: org.h2.Driver
jpa:
hibernate.ddl-auto: create-drop
show-sql: true
defer-datasource-initialization: true
# properties.hibernate.format_sql: true
postgresql tips: https://youtu.be/9SGDpanrc8U?t=2273
@Transient means the field is not for DB
Spring Data JPA https://www.youtube.com/watch?v=8SGI_XS5OPw
How To Handle Exceptions
https://www.youtube.com/watch?v=PzK4ZXa2Tbc
https://www.youtube.com/watch?v=jFZ4lLLkT7M
??? complete course??? https://www.youtube.com/watch?v=8SGI_XS5OPw&list=PLwvrYc43l1MzeA2bBYQhCWr2gvWLs9A7S
fullstack https://www.youtube.com/watch?v=i-hoSg8iRG0&list=PLwvrYc43l1MzeA2bBYQhCWr2gvWLs9A7S&index=4
Spring Security Tutorial - [NEW] [2023] https://www.youtube.com/watch?v=b9O9NI-RJ3o
@Bean
CommandLineRunner commandLineRunner() {
return args -> {
System.out.println(Arrays.toString(args));
};
}
Software Testing Tutorial - Learn Unit Testing and Integration Testing: https://www.youtube.com/watch?v=Geq60OVyBPg
Mockito: https://youtu.be/Geq60OVyBPg?t=2835
@ExtendWith(MockitoExtension.class)
ArgumentCaptor: https://youtu.be/Geq60OVyBPg?t=3506
given(repo.findById(anyInt()),willReturn(true)
Microservices Using Spring Boot and Spring Cloud
https://www.youtube.com/watch?v=p485kUNpPvE&list=PLwvrYc43l1Mwqpf9i-1B1gXfMeHOm6DeY
10 common mistakes:
Constructor Dependency Injection (not setter)
DefaultExceptionHandler https://youtu.be/CT8dbbe783s?t=558