File tree Expand file tree Collapse file tree 34 files changed +52
-66
lines changed
0-0-1-welcome-to-java-web-exercises
1-0-0-hello-network-socket
3-0-0-hello-spring-framework
src/test/java/com/bobocode
3-1-1-dispatcher-servlet-initializer
5-0-spring-boot-rest-client
src/main/java/com/bobocode/util
spring-framework-exercises-model
src/main/java/com/bobocode/model
spring-framework-exercises-util
src/main/java/com/bobocode Expand file tree Collapse file tree 34 files changed +52
-66
lines changed Original file line number Diff line number Diff line change 16
16
17
17
if : github.event.action == 'opened' || contains(github.event.issue.labels.*.name, 'java-web')
18
18
with :
19
- project : ' https://github.com/bobocode-projects/java-web-course /projects/1'
19
+ project : ' https://github.com/bobocode-projects/java-web-exercises /projects/1'
Original file line number Diff line number Diff line change 1
- # <img src =" https://raw.githubusercontent.com/bobocode-projects/resources/master/image/logo_transparent_background.png " height =50/ > Welcome to Java Web Course
1
+ # <img src =" https://raw.githubusercontent.com/bobocode-projects/resources/master/image/logo_transparent_background.png " height =50/ > Welcome to Java Web Exercises
2
2
3
3
This is a welcome test project to check if everything works okay on your computer
4
4
5
5
### You should have installed on your local machine ❗️
6
- * [ JDK 11 +] ( https ://jdk.java.net/15 /)
6
+ * [ JDK 17 +] ( hhttps ://jdk.java.net/17 /)
7
7
* [ Git] ( https://git-scm.com/book/en/v2/Getting-Started-Installing-Git )
8
8
9
9
### How to start ❓
10
10
11
11
* Just ** clone the repository** to your computer
12
- * Open project in your IDE and ** configure JDK 11 ** for the project
12
+ * Open project in your IDE and ** configure JDK 17 ** for the project
13
13
* Open terminal and ** run a command** ` ./mvnw clean package ` (UNIX) or ` mvnw.cmd clean package ` (Windows)
14
14
* Open class ` WelcomeToJavaWebCourseApp ` and ** run** ` main() `
15
15
* [ Click here] ( http://localhost:8080/welcome ) 🔗
Original file line number Diff line number Diff line change 9
9
</parent >
10
10
<modelVersion >4.0.0</modelVersion >
11
11
12
- <artifactId >0-0-1-welcome-to-java-web-course </artifactId >
12
+ <artifactId >0-0-1-welcome-to-java-web-exercises </artifactId >
13
13
14
14
<properties >
15
- <maven .compiler.source>11</maven .compiler.source>
16
- <maven .compiler.target>11</maven .compiler.target>
17
15
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
18
16
<project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
19
17
</properties >
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 6
6
</ head >
7
7
< body align ="center ">
8
8
< p style ="font-size: 64px; margin-top: 10% " th:text ="${name != null} ? ${name} + ',' : ' ' "> </ p >
9
- < p style ="font-size: 64px; margin-top: 8% "> Welcome to < b > Java Web Course </ b > </ p >
9
+ < p style ="font-size: 64px; margin-top: 8% "> Welcome to < b > Java Web Exercises </ b > </ p >
10
10
< div >
11
11
< img src ="https://raw.githubusercontent.com/bobocode-projects/resources/master/image/bobo_logo.png "
12
12
style ="width: 30% "/>
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course </artifactId >
6
+ <artifactId >java-web-exercises </artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
12
12
<artifactId >0-0-intro</artifactId >
13
13
<packaging >pom</packaging >
14
14
<modules >
15
- <module >0-0-1-welcome-to-java-web-course </module >
15
+ <module >0-0-1-welcome-to-java-web-exercises </module >
16
16
</modules >
17
17
18
18
</project >
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Learn **Sockets** – the essential part of Java networking 💪
20
20
21
21
---
22
22
23
- #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-course /tree/main/0-0-intro#introduction )
23
+ #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-exercises /tree/main/0-0-intro#introduction )
24
24
25
25
##
26
26
<div align =" center " ><img src =" https://raw.githubusercontent.com/bobocode-projects/resources/master/animation/GitHub%20Star_3.gif " height =50/ ></div >
Original file line number Diff line number Diff line change 10
10
<modelVersion >4.0.0</modelVersion >
11
11
12
12
<artifactId >1-0-0-hello-network-socket</artifactId >
13
- <properties >
14
- <maven .compiler.source>11</maven .compiler.source>
15
- <maven .compiler.target>11</maven .compiler.target>
16
- </properties >
17
13
18
14
19
15
</project >
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course </artifactId >
6
+ <artifactId >java-web-exercises </artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
Original file line number Diff line number Diff line change 2
2
Start learning Servlet API – the foundation of Java web applications 💪
3
3
4
4
### Pre-conditions ❗
5
- You're supposed to be familiar with [ Java Fundamentals] ( https://github.com/bobocode-projects/java-fundamentals-course #welcome-to-the-java-fundamentals-course )
5
+ You're supposed to be familiar with [ Java Fundamentals] ( https://github.com/bobocode-projects/java-fundamentals-exercises #welcome-to-the-java-fundamentals-exercises )
6
6
7
7
### Objectives
8
8
* ** install** [ Apache Tomcat Container] ( https://tomcat.apache.org/download-90.cgi ) locally (if you don't have it yet) ✅
43
43
[ ![ Linked List] ( https://yt-embed.herokuapp.com/embed?v=s11Fjue5Svs )] ( https://youtu.be/s11Fjue5Svs )
44
44
45
45
---
46
- #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-course /tree/main/0-0-intro#introduction )
46
+ #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-exercises /tree/main/0-0-intro#introduction )
47
47
48
48
##
49
49
<div align =" center " ><img src =" https://raw.githubusercontent.com/bobocode-projects/resources/master/animation/GitHub%20Star_3.gif " height =50/ ></div >
Original file line number Diff line number Diff line change 13
13
<packaging >war</packaging >
14
14
15
15
<properties >
16
- <maven .compiler.source>11</maven .compiler.source>
17
- <maven .compiler.target>11</maven .compiler.target>
18
16
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
19
17
<project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
20
18
</properties >
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course </artifactId >
6
+ <artifactId >java-web-exercises </artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ You're supposed to be familiar with *Spring IoC* and *Dependency injection*
23
23
[ ![ Linked List] ( https://yt-embed.herokuapp.com/embed?v=IjyYJhIRNG4 )] ( https://youtu.be/IjyYJhIRNG4 )
24
24
25
25
---
26
- #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-course /tree/main/0-0-intro#introduction )
26
+ #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-exercises /tree/main/0-0-intro#introduction )
27
27
28
28
##
29
29
<div align =" center " ><img src =" https://raw.githubusercontent.com/bobocode-projects/resources/master/animation/GitHub%20Star_3.gif " height =50/ ></div >
Original file line number Diff line number Diff line change 1
1
package com .bobocode ;
2
2
3
+ import static org .assertj .core .api .Assertions .assertThat ;
4
+
3
5
import com .bobocode .dao .AccountDao ;
4
- import com .bobocode .dao .FakeAccountDao ;
5
6
import com .bobocode .service .AccountService ;
6
- import org .junit .jupiter .api .*;
7
+ import java .util .Map ;
8
+ import org .junit .jupiter .api .DisplayName ;
9
+ import org .junit .jupiter .api .MethodOrderer ;
10
+ import org .junit .jupiter .api .Order ;
11
+ import org .junit .jupiter .api .Test ;
12
+ import org .junit .jupiter .api .TestMethodOrder ;
7
13
import org .springframework .beans .factory .annotation .Autowired ;
8
14
import org .springframework .context .ApplicationContext ;
9
15
import org .springframework .context .annotation .ComponentScan ;
10
16
import org .springframework .context .annotation .Configuration ;
11
17
import org .springframework .test .context .junit .jupiter .SpringJUnitConfig ;
12
18
13
- import java .util .Map ;
14
-
15
- import static org .assertj .core .api .Assertions .assertThat ;
16
- import static org .junit .jupiter .api .Assertions .assertNotNull ;
17
-
18
19
@ SpringJUnitConfig
19
20
@ TestMethodOrder (MethodOrderer .OrderAnnotation .class )
20
21
class ApplicationContextTest {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Improve your *SSpring MVC* skills
6
6
7
7
---
8
8
9
- #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-course /tree/main/0-0-intro#introduction )
9
+ #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-exercises /tree/main/0-0-intro#introduction )
10
10
11
11
##
12
12
<div align =" center " ><img src =" https://raw.githubusercontent.com/bobocode-projects/resources/master/animation/GitHub%20Star_3.gif " height =50/ ></div >
Original file line number Diff line number Diff line change 14
14
15
15
<properties >
16
16
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
17
- <maven .compiler.source>11</maven .compiler.source>
18
- <maven .compiler.target>11</maven .compiler.target>
19
17
</properties >
20
18
21
19
<dependencies >
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ You're supposed to be familiar with *Spring MVC*
19
19
todo
20
20
21
21
---
22
- #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-course /tree/main/0-0-intro#introduction )
22
+ #### 🆕 First time here? – [ See Introduction] ( https://github.com/bobocode-projects/java-fundamentals-exercises /tree/main/0-0-intro#introduction )
23
23
24
24
##
25
25
<div align =" center " ><img src =" https://raw.githubusercontent.com/bobocode-projects/resources/master/animation/GitHub%20Star_3.gif " height =50/ ></div >
Original file line number Diff line number Diff line change 33
33
<plugin >
34
34
<groupId >org.apache.maven.plugins</groupId >
35
35
<artifactId >maven-war-plugin</artifactId >
36
- <version >2.6 </version >
36
+ <version >3.3.2 </version >
37
37
<configuration >
38
38
<failOnMissingWebXml >false</failOnMissingWebXml >
39
39
</configuration >
Original file line number Diff line number Diff line change 44
44
<plugin >
45
45
<groupId >org.apache.maven.plugins</groupId >
46
46
<artifactId >maven-war-plugin</artifactId >
47
- <version >2.6 </version >
47
+ <version >3.3.2 </version >
48
48
<configuration >
49
49
<failOnMissingWebXml >false</failOnMissingWebXml >
50
50
</configuration >
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course </artifactId >
6
+ <artifactId >java-web-exercises </artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course </artifactId >
6
+ <artifactId >java-web-exercises </artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course </artifactId >
6
+ <artifactId >java-web-exercises </artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
Original file line number Diff line number Diff line change 1
- # <img src =" https://raw.githubusercontent.com/bobocode-projects/resources/master/image/logo_transparent_background.png " height =50/ >Welcome to the Java Web Course
1
+ # <img src =" https://raw.githubusercontent.com/bobocode-projects/resources/master/image/logo_transparent_background.png " height =50/ >Welcome to the Java Web Exercises
2
2
Build strong networking and web development skills that you will need for real-world Enterprise Java development
3
3
4
4
## Why
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course -util</artifactId >
6
+ <artifactId >java-web-exercises -util</artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
File renamed without changes.
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course </artifactId >
6
+ <artifactId >java-web-exercises </artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
10
10
<modelVersion >4.0.0</modelVersion >
11
11
<packaging >pom</packaging >
12
12
13
- <artifactId >java-web-course -util</artifactId >
13
+ <artifactId >java-web-exercises -util</artifactId >
14
14
15
15
<modules >
16
16
<module >spring-framework-exercises-model</module >
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course -util</artifactId >
6
+ <artifactId >java-web-exercises -util</artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course -util</artifactId >
6
+ <artifactId >java-web-exercises -util</artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
19
19
<version >1.0-SNAPSHOT</version >
20
20
</dependency >
21
21
<dependency >
22
- <groupId >io.codearte.jfairy </groupId >
22
+ <groupId >com.devskiller </groupId >
23
23
<artifactId >jfairy</artifactId >
24
- <version >0.5.7 </version >
24
+ <version >0.6.5 </version >
25
25
</dependency >
26
26
</dependencies >
27
27
</project >
Original file line number Diff line number Diff line change 2
2
3
3
import com .bobocode .model .Account ;
4
4
import com .bobocode .model .Gender ;
5
- import io .codearte .jfairy .Fairy ;
6
- import io .codearte .jfairy .producer .person .Person ;
7
-
5
+ import com .devskiller .jfairy .Fairy ;
6
+ import com .devskiller .jfairy .producer .person .Person ;
8
7
import java .math .BigDecimal ;
9
8
import java .time .LocalDate ;
10
9
import java .time .LocalDateTime ;
11
10
import java .util .concurrent .ThreadLocalRandom ;
12
11
13
12
public class TestDataGenerator {
13
+
14
14
public Account generateAccount () {
15
15
Fairy fairy = Fairy .create ();
16
16
Person person = fairy .person ();
@@ -30,7 +30,7 @@ private Account convertToAccount(Person person) {
30
30
account .setEmail (person .getEmail ());
31
31
account .setBirthday (LocalDate .of (
32
32
person .getDateOfBirth ().getYear (),
33
- person .getDateOfBirth ().getMonthOfYear (),
33
+ person .getDateOfBirth ().getMonth (),
34
34
person .getDateOfBirth ().getDayOfMonth ()));
35
35
account .setGender (Gender .valueOf (person .getSex ().name ()));
36
36
return account ;
Original file line number Diff line number Diff line change 3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
5
<parent >
6
- <artifactId >java-web-course </artifactId >
6
+ <artifactId >java-web-exercises </artifactId >
7
7
<groupId >com.bobocode</groupId >
8
8
<version >1.0-SNAPSHOT</version >
9
9
</parent >
10
10
<modelVersion >4.0.0</modelVersion >
11
11
12
12
<artifactId >lesson-demo</artifactId >
13
13
14
- <properties >
15
- <maven .compiler.source>11</maven .compiler.source>
16
- <maven .compiler.target>11</maven .compiler.target>
17
- </properties >
18
-
19
14
<dependencies >
20
15
<dependency >
21
16
<groupId >jakarta.servlet</groupId >
You can’t perform that action at this time.
0 commit comments