Skip to content
Merged

gg #2

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
763 commits
Select commit Hold shift + click to select a range
08c8d82
add java zip examples
Doha2012 Apr 4, 2016
3061fc7
Add file upload example
ivanp81 Apr 4, 2016
4ec8015
Spring HATEOAS support
roshanathomas Apr 6, 2016
cdeb714
Spring HATEOAS support - multiple links
roshanathomas Apr 7, 2016
c6575d0
formating Spring HATEOAS dependency
roshanathomas Apr 7, 2016
44eca5b
Merge branch 'master' of https://github.com/ivanp81/tutorials into iv…
davidmorley Apr 7, 2016
9630170
Rename package
davidmorley Apr 7, 2016
923f5c4
Merge branch 'ivanp81-master'
davidmorley Apr 7, 2016
fdcea19
The example code for the article "A Guide to the Fork/Join Framework"
Apr 7, 2016
d575f44
minor fix
Doha2012 Apr 8, 2016
25f4546
Spring Data Couchbase Article 2
KevinGilmore Apr 8, 2016
167187f
Merge remote-tracking branch 'upstream/master'
KevinGilmore Apr 8, 2016
ae57f05
Merge remote-tracking branch 'refs/remotes/eugenp/master'
codethinker09 Apr 8, 2016
63f1bd7
Merge remote-tracking branch 'refs/remotes/eugenp/master' into XStrea…
codethinker09 Apr 8, 2016
ab3f68f
Test Cases - XStream Object to-from json
codethinker09 Apr 8, 2016
a6768e6
minor fix
Doha2012 Apr 9, 2016
17a72d0
Spring HATEOAS - separating order service
roshanathomas Apr 9, 2016
44c327d
Add expected exception handling to test
davidmorley Apr 11, 2016
ce2891e
Clean up formatting
davidmorley Apr 11, 2016
3a5dc3d
Merge code for XStream JSON processing article
davidmorley Apr 11, 2016
4714440
cleanup spring security test
Doha2012 Apr 12, 2016
97e2842
Merge branch 'master' of https://github.com/aborkov/tutorials into ab…
davidmorley Apr 12, 2016
f2dd909
Clean up SpEL examples
davidmorley Apr 12, 2016
ed1c562
Add code for Spring Expression Language article
davidmorley Apr 12, 2016
2ce4f5a
Merge branch 'master' of github.com:eugenp/tutorials
davidmorley Apr 12, 2016
9ca4d9f
added my github name
shyamramath Apr 13, 2016
4ab9fe6
Clean up SpEL examples
davidmorley Apr 14, 2016
c2d84ae
allOrders URL implementation
roshanathomas Apr 15, 2016
52728c6
Merge branch 'master' of https://github.com/skoiloth/tutorials into s…
davidmorley Apr 15, 2016
46da6af
Clean up Spring REST Docs examples
davidmorley Apr 15, 2016
0815d31
Add examples for Spring REST Docs article
davidmorley Apr 15, 2016
c574b94
- Added code for JUnit 5 article
amedviediev Apr 15, 2016
70e9d2f
Add websocket example
ivanp81 Apr 18, 2016
4d1dd06
Add websocket example
ivanp81 Apr 18, 2016
4b18d13
Added controller for returning media in response body
yuriikostyshyn Apr 18, 2016
3601821
Added controller for returning image in response body with configurat…
yuriikostyshyn Apr 18, 2016
a3c9183
change processing()
Apr 18, 2016
fa23486
Merge branch 'master' of https://github.com/alexVengrovsk/tutorials i…
davidmorley Apr 21, 2016
8cbf2e3
Clean up core-java-8 samples
davidmorley Apr 21, 2016
0ac51ec
Add examples for Fork/Join framework
davidmorley Apr 21, 2016
398b0e3
Merge pull request #402 from roshanathomas/master
slavisa-baeldung Apr 21, 2016
4f410a7
hateoas - minor changes for self and method link creation
slavisa-baeldung Apr 21, 2016
0adca43
spring-hateoas - changing the mapping
slavisa-baeldung Apr 22, 2016
c042617
Add (commented out) config for Spring Channel Security
Apr 16, 2016
cddd150
Refined the url pattern for perform_login, remove permitAll (it's not…
Apr 24, 2016
29deacf
minor cleanup work
Apr 25, 2016
c3abba5
scopes examples
lor6 Apr 27, 2016
5dffa19
initial commit for mockito mock methods
nguyennamthai Apr 27, 2016
889b266
Add websocket example
ivanp81 Apr 27, 2016
ffe646f
initial commit for powermockito
nguyennamthai Apr 27, 2016
fa332b3
Clean up Mockito and Powermockito examples
davidmorley Apr 28, 2016
f5bbd2c
Add sample code for Powermockito article
davidmorley Apr 28, 2016
378d0c0
minor cleanup
Apr 30, 2016
a875e25
- Added code for JUnit 5 article
amedviediev May 2, 2016
01be10e
/anonymous.html doesn't require http to set explicitely after we set …
May 2, 2016
6b8512c
Merge branch 'master' into channel-security
May 2, 2016
d0aee4e
Create new sec conf activated by https spring profile based on Slavis…
May 2, 2016
f83d3dc
caching work
May 3, 2016
94061d7
Merge branch 'master' of https://github.com/nguyennamthai/tutorials i…
davidmorley May 4, 2016
174e058
Examples for Mockito's Mock Methods
davidmorley May 4, 2016
c8a4818
Add examples for Mockito's Mock Methods
davidmorley May 4, 2016
e4c1de0
Merge pull request #2 from eugenp/master
SameeraNel May 4, 2016
b0b3a20
Adding neo4j project skeleton
SameeraNel May 4, 2016
ed72ff4
Add websocket example
ivanp81 May 5, 2016
e792db4
revised bean scopes examples
lor6 May 5, 2016
06adf29
Merge pull request #417 from kohanyirobert/channel-security
slavisa-baeldung May 6, 2016
7d38405
Adding example project
SameeraNel May 8, 2016
8749653
Adding example project
SameeraNel May 8, 2016
78bfd55
Adding example project
SameeraNel May 8, 2016
a317e91
Adding example project
SameeraNel May 8, 2016
8bd5e12
minor formatting work
May 9, 2016
a58a896
Merge pull request #410 from yuriikostyshyn/YKostyshyn_spring_mvc_1
slavisa-baeldung May 10, 2016
a72def9
image-download - adding jsp and plain copy to response method
slavisa-baeldung May 10, 2016
d2ca517
image-download - removing unused import
slavisa-baeldung May 10, 2016
fe22d59
image-download - wrapping resource inside response entity
slavisa-baeldung May 10, 2016
f7176e6
- Added code for JUnit 5 article
amedviediev May 10, 2016
dda24d5
Re-clone Spring-rest-docs
shyamramath May 12, 2016
5fb75f5
Merge branch 'master' of https://github.com/ivanp81/tutorials into iv…
davidmorley May 12, 2016
3896065
Add Spring WebSocket example
davidmorley May 12, 2016
6f95540
Adding Book service interface
SameeraNel May 13, 2016
6e6b461
Adding test cases
SameeraNel May 13, 2016
3e3079e
added xml folder in jackson module,have no idea what am doing :)
egimaben May 15, 2016
75d0eb4
basics of spring autowire - first cut
May 15, 2016
fbd2d57
image-download - Fine grained exception handling
slavisaavramovic May 17, 2016
b572a90
image-download - removing exception handling
slavisaavramovic May 17, 2016
3a0cdf1
Merge branch 'master' of https://github.com/amedviediev/tutorials int…
davidmorley May 17, 2016
61e7164
made recommended changes
egimaben May 17, 2016
433bc63
Code for the article "Java 8’s Features"
May 16, 2016
c4fdeee
- Fixed assertAll code
amedviediev May 21, 2016
263d171
xml-serialize-deserialize - minor changes
slavisaavramovic May 22, 2016
9c1d1b4
Merge branch 'pr/423-bengi'
slavisaavramovic May 22, 2016
7335ef2
xml-serialize-deserialize - pom formatting
slavisaavramovic May 22, 2016
28d6a01
Merge branch 'master' of https://github.com/skoiloth/tutorials into s…
davidmorley May 23, 2016
e7ec500
Clean up Spring REST Docs examples
davidmorley May 23, 2016
fb6d5f2
Merge branch 'skoiloth-master'
davidmorley May 23, 2016
9844cd6
Add Spring REST Docs examples
davidmorley May 23, 2016
4c39dba
Merge branch 'master' of github.com:eugenp/tutorials
davidmorley May 23, 2016
4bc347a
Merge branch 'master' of https://github.com/amedviediev/tutorials int…
davidmorley May 23, 2016
e641ca0
Reformat JUnit 5 examples
davidmorley May 23, 2016
bcc31e1
Add JUnit 5 examples
davidmorley May 23, 2016
b1eab75
Guide to Spring @Autowired
atheedom May 23, 2016
9b04dff
Merge pull request #425 from alexVengrovsk/master
slavisa-baeldung May 24, 2016
f972513
java8features - new java 8 features
slavisa-baeldung May 24, 2016
44e5069
First cut for basics of java 8 date time api
May 25, 2016
0a3f723
Merge branch 'master' into java8DateTime
May 25, 2016
e8bbe6e
initial commit for wiremock
nguyennamthai May 26, 2016
ef53002
spring-jsf-integration - mavenizing
slavisaavramovic May 21, 2016
6e6f7c4
jsf-spring-integration - mavenizing
slavisa-baeldung May 26, 2016
98fbb50
jsf-spring-integration - cleaning up
slavisa-baeldung May 26, 2016
5635d48
jsf-spring-integration - chaning the logger
slavisa-baeldung May 26, 2016
c76666a
jsf-spring-integration - adding gitignore
slavisa-baeldung May 26, 2016
193adf8
jsf-spring-integration - minor refactors
slavisa-baeldung May 26, 2016
ce7c395
A Gatling load test demo
ivanp81 May 27, 2016
b67ecea
cleanup
Doha2012 May 28, 2016
65e423c
upgrade to elastic search 2
Doha2012 May 28, 2016
ae11d34
minor cleanup
Doha2012 May 28, 2016
b44cf0d
minor fix
Doha2012 May 28, 2016
abb5490
Merge pull request #405 from KevinGilmore/master
May 28, 2016
27c1ed3
Merge remote-tracking branch 'origin/master'
slavisa-baeldung May 29, 2016
db9ecdb
introduction to wiremock
nguyennamthai May 29, 2016
1cf09ba
minor fixes
nguyennamthai May 29, 2016
46cc39e
add swagger test
Doha2012 May 30, 2016
b36e9a3
update swagger
Doha2012 May 30, 2016
c8121c1
Core java enum examples
May 30, 2016
14012a0
Enum examples for java8
May 30, 2016
794e084
jsf-spring-integration - moving to java config
slavisa-baeldung May 30, 2016
abb64b2
modifications to request and session scopes examples
lor6 May 31, 2016
c8a8132
Merge pull request #432 from PriyaKrishna/master
atheedom May 31, 2016
fd27912
Merge pull request #1 from eugenp/master
atheedom May 31, 2016
2f5f965
Some minor changes to style and to sync with article code
atheedom May 31, 2016
55c43d5
Merge pull request #433 from atheedom/master
atheedom May 31, 2016
882a9b5
cleanup format
Doha2012 Jun 1, 2016
a75cad6
upgrade and add test
Doha2012 Jun 1, 2016
2e9efa1
Spring Data Couchbase tutorial: multiple buckets and spatial queries
KevinGilmore Jun 3, 2016
23e8b11
Merge remote-tracking branch 'upstream/master'
KevinGilmore Jun 3, 2016
cbecbab
Merge pull request #435 from KevinGilmore/master
Jun 3, 2016
4b4b09a
Merge pull request #413 from lor6/scopes-examples
Jun 3, 2016
b11f8ea
spring-jsf-integration - adding maven-war-plugin
slavisaavramovic Jun 6, 2016
36af7ed
Merge remote-tracking branch 'origin/master'
slavisaavramovic Jun 6, 2016
635a5aa
Added guava set+function=map tutorial and tests
egimaben Jun 6, 2016
a6e31c6
Merge branch 'master' into wiremock_intro
nguyennamthai Jun 6, 2016
f53ac9d
adds the wire_mock.json file
nguyennamthai Jun 6, 2016
c38e6c1
initial commit for rest testing with cucumber
nguyennamthai Jun 6, 2016
49c9072
Merge pull request #430 from sivabalachandran/java8DateTime
atheedom Jun 6, 2016
42ce4d4
Merge pull request #2 from eugenp/master
atheedom Jun 6, 2016
aadaba0
Introduction to WireMock (#437)
nguyennamthai Jun 7, 2016
04c942f
Spring Boot Support for jOOQ (#438)
nguyennamthai Jun 7, 2016
4eca00c
Merge branch 'cucumber' of git://github.com/nguyennamthai/tutorials i…
Jun 7, 2016
a297e49
Merge branch 'nguyennamthai-cucumber'
Jun 7, 2016
eadbde5
Remove autogenerated jOOQ files
Jun 7, 2016
34abb0e
Refactor jOOQ-Spring
Jun 7, 2016
b7812b9
Refactor .gitignore
Jun 7, 2016
27250c6
Refactor wiremock/cucumber examples
Jun 7, 2016
665afc0
Revert jOOQ Application.java
Jun 7, 2016
d8cd30d
Fix Application.java
Jun 7, 2016
632a1f6
Leverage Spring Boot's autoconfiguration (#441)
pivovarit Jun 8, 2016
5c8961e
Remove gatling load test demo
ivanp81 Jun 8, 2016
737848c
Gatling load test demo
ivanp81 Jun 8, 2016
9be037e
Merge pull request #442 from ivanp81/master
Jun 8, 2016
2452e58
jee7schedule
ccristian Jun 8, 2016
a156fa8
Introduction to XPath
Asheara Jun 8, 2016
1443978
Merge pull request #444 from Asheara/master
Jun 8, 2016
8159334
Updates for @ModelAttribute example
teobais Jun 8, 2016
7eabc6c
Code and related files for the dependency injection demos.
reymalahay Jun 1, 2016
1103717
Merge pull request #447 from atheedom/master
atheedom Jun 9, 2016
8d6526c
Some minor changes to code logic and style
atheedom Jun 9, 2016
de4899e
Merge pull request #448 from atheedom/master
atheedom Jun 9, 2016
60ae051
Merge pull request #434 from reymalahay/master
atheedom Jun 9, 2016
f4ee749
Merge pull request #445 from toubou91/master
atheedom Jun 9, 2016
9835081
Code for the article "Java 8 Stream API Tutorial"
Jun 9, 2016
7ecd7ce
Code and tests for the lombok introduction.
MiguelGL Jun 12, 2016
577beec
Merge pull request #449 from MiguelGL/master
Jun 12, 2016
3c0a53e
Rename lombok-intro to just lombok.
MiguelGL Jun 12, 2016
6123c31
Merge pull request #450 from MiguelGL/master
Jun 12, 2016
31eaa0e
interesting httpclient digest auth example
Jun 12, 2016
14cd932
interesting httpclient digest auth example
Jun 12, 2016
73471f6
Update README.md
Jun 12, 2016
4e01eb6
Merge pull request #443 from ccristian/master
atheedom Jun 13, 2016
e76f8e6
Merge pull request #3 from eugenp/master
atheedom Jun 13, 2016
302df05
Merge pull request #451 from atheedom/master
atheedom Jun 14, 2016
f5ecf03
Merge pull request #446 from alexVengrovsk/java8-stream
slavisa-baeldung Jun 15, 2016
a5bde90
java-streams-8-api - adding slf4j fixing indentation
slavisa-baeldung Jun 15, 2016
70322e1
spring-mvc-matrix-variables - manually merging
slavisa-baeldung Jun 15, 2016
22cebf3
cleanup
Doha2012 Jun 17, 2016
b72f319
httpclient digest examples
Doha2012 Jun 17, 2016
604e79d
modify httpclient digest test
Doha2012 Jun 17, 2016
b9ddf5f
Merge pull request #436 from egimaben/master
slavisa-baeldung Jun 18, 2016
9a91590
Add mock-comparisons module (#453)
varomorf Jun 18, 2016
d9223b2
Refactor mock-comparisons
Jun 18, 2016
85ad446
First commit of protocol buffers. (#452)
nguyennamthai Jun 18, 2016
c77a992
Refactor spring-protobuf
Jun 18, 2016
b1bdeb9
minor formatting work
Jun 18, 2016
2b2022c
Refactor spring-protobuf
Jun 18, 2016
83df968
Initial commit
Jun 20, 2016
a871f25
Add first set of assertions
Jun 21, 2016
4aa5f7f
Add second set of assertions
Jun 21, 2016
2802971
minor cleanup
Jun 22, 2016
bea86d4
Merge pull request #455 from pivovarit/assertj-introduction
atheedom Jun 22, 2016
d429cb4
Code and tests for AssertJ
atheedom Jun 22, 2016
3c17c9e
minor cleanup
Jun 22, 2016
2f627a0
Merge branch 'master' of https://github.com/eugenp/tutorials
Jun 23, 2016
0d1d3cb
minor cleanup
Jun 23, 2016
920991e
Pom fix
Jun 23, 2016
b3e9b08
Update README.md
Jun 23, 2016
024b4f8
Add additional AssertJ examples
Jun 23, 2016
57ed00a
Code examples for Java 8 date migration (#460)
GhostInAMachine Jun 24, 2016
96182a2
Just setting encoding for module on mock comparison. (#461)
varomorf Jun 25, 2016
a661e0e
Add additional AssertJ examples
Jun 25, 2016
330c868
XML libraries support (#463)
Asheara Jun 26, 2016
40ed303
Refactor xml examples
Jun 26, 2016
718c04c
updating test cases
SameeraNel Jun 28, 2016
6d897e6
Update README.md
m0cacin0 Jun 28, 2016
d232553
Update README.md
m0cacin0 Jun 28, 2016
594ab38
Update README.md
m0cacin0 Jun 28, 2016
49e9968
Update README.md
m0cacin0 Jun 28, 2016
92d44e3
Update README.md
m0cacin0 Jun 28, 2016
862c13e
Update README.md
m0cacin0 Jun 28, 2016
413ccc7
Update README.md
m0cacin0 Jun 28, 2016
7d1d632
Create README.MD
m0cacin0 Jun 28, 2016
779b8ec
Create README.MD
m0cacin0 Jun 28, 2016
46d5938
Update README.md
m0cacin0 Jun 28, 2016
2d65d52
Update README.md
m0cacin0 Jun 28, 2016
1f26660
Update README.md
m0cacin0 Jun 28, 2016
96e903f
Create README.MD
m0cacin0 Jun 28, 2016
7d7c5f3
Update README.md
m0cacin0 Jun 28, 2016
89cae68
Update README.md
m0cacin0 Jun 28, 2016
134a4a0
Create README.MD
m0cacin0 Jun 28, 2016
4e183ef
Create README.MD
m0cacin0 Jun 28, 2016
f0e103b
Update README.md
m0cacin0 Jun 28, 2016
915fa89
Update README.md
m0cacin0 Jun 28, 2016
5b80cbd
Update README.md
m0cacin0 Jun 28, 2016
71e18a2
Update README.md
m0cacin0 Jun 28, 2016
2018411
Update README.md
m0cacin0 Jun 28, 2016
4c912d8
Update README.md
m0cacin0 Jun 28, 2016
ed9a36b
Update README.md
m0cacin0 Jun 28, 2016
4162c46
Update README.md
m0cacin0 Jun 28, 2016
e3fc9bc
Update README.md
m0cacin0 Jun 28, 2016
9b7cf11
Update README.md
m0cacin0 Jun 28, 2016
ea0907b
Update README.md
m0cacin0 Jun 28, 2016
a79e7b7
Update README.md
m0cacin0 Jun 28, 2016
1a3e005
updating test cases
SameeraNel Jun 28, 2016
5483651
updating test cases
SameeraNel Jun 28, 2016
31b3e0f
updating test cases
SameeraNel Jun 28, 2016
d4c2d50
updating test cases
SameeraNel Jun 28, 2016
0ab6270
Last changes (#468)
Asheara Jun 28, 2016
1ea5205
Merge pull request #467 from sameira/master
Jun 28, 2016
5137277
Code and related files for the dependency injection demos.
reymalahay Jun 1, 2016
12b3c49
Merge pull request #458 from reymalahay/master
atheedom Jun 29, 2016
a2d20da
Create README.MD
m0cacin0 Jun 30, 2016
0b674fb
Update README.MD
m0cacin0 Jun 30, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@

# Eclipse
.settings/
*.project
*.classpath
.prefs
*.prefs
.metadata/

# Intellij
.idea/
Expand All @@ -21,3 +24,6 @@
# Maven
log/
target/

spring-openid/src/main/resources/application.properties
.recommenders/
22 changes: 14 additions & 8 deletions .project
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>parent</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
<name>parent-modules</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

The "REST with Spring" Classes
==============================
This is what I'm working on: <br/>
**[>> THE REST WITH SPRING CLASSES](http://www.baeldung.com/rest-with-spring-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=25off)**
After 5 months of work, here's the Master Class of REST With Spring: <br/>
**[>> THE REST WITH SPRING MASTER CLASS](http://www.baeldung.com/rest-with-spring-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=rws#master-class)**


Spring Tutorials
Expand All @@ -19,3 +19,8 @@ Any IDE can be used to work with the projects, but if you're using Eclipse, cons

- import the included **formatter** in Eclipse:
`https://github.com/eugenp/tutorials/tree/master/eclipse`


CI - Jenkins
================================
This tutorials project is being built **[>> HERE](https://rest-security.ci.cloudbees.com/job/tutorials/)**
26 changes: 11 additions & 15 deletions apache-fop/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId>
<groupId>com.baeldung</groupId>
<artifactId>apache-fop</artifactId>
<version>0.1-SNAPSHOT</version>

Expand Down Expand Up @@ -37,7 +37,7 @@

<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
Expand Down Expand Up @@ -142,16 +142,12 @@
</build>

<properties>
<!-- Spring -->
<org.springframework.version>4.1.5.RELEASE</org.springframework.version>
<org.springframework.security.version>3.2.5.RELEASE</org.springframework.security.version>

<!-- persistence -->
<hibernate.version>4.3.8.Final</hibernate.version>
<mysql-connector-java.version>5.1.34</mysql-connector-java.version>
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>

<!-- marshalling -->
<jackson.version>2.4.4</jackson.version>
<jackson.version>2.7.2</jackson.version>

<!-- logging -->
<org.slf4j.version>1.7.9</org.slf4j.version>
Expand All @@ -161,25 +157,25 @@
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>

<!-- util -->
<guava.version>17.0</guava.version> <!-- upgrade to 18.0 -->
<guava.version>19.0</guava.version>
<commons-lang3.version>3.3.2</commons-lang3.version>

<!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.11</junit.version>
<junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version>

<httpcore.version>4.4</httpcore.version>
<httpclient.version>4.4</httpclient.version>

<rest-assured.version>2.4.0</rest-assured.version>
<rest-assured.version>2.9.0</rest-assured.version>

<!-- maven plugins -->
<maven-compiler-plugin.version>3.2</maven-compiler-plugin.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.12</cargo-maven2-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>

</properties>

Expand Down
38 changes: 38 additions & 0 deletions assertj/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.baeldung</groupId>
<artifactId>assertj</artifactId>
<version>1.0.0-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.4.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.baeldung.assertj.introduction.domain;

public class Dog {
private String name;
private Float weight;

public Dog(String name, Float weight) {
this.name = name;
this.weight = weight;
}

public String getName() {
return name;
}

public Float getWeight() {
return weight;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.baeldung.assertj.introduction.domain;

public class Person {
private String name;
private Integer age;

public Person(String name, Integer age) {
this.name = name;
this.age = age;
}

public String getName() {
return name;
}

public Integer getAge() {
return age;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
package com.baeldung.assertj.introduction;

import com.baeldung.assertj.introduction.domain.Dog;
import com.baeldung.assertj.introduction.domain.Person;
import org.assertj.core.util.Maps;
import org.junit.Ignore;
import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
import static org.assertj.core.api.Assertions.withPrecision;

public class AssertJCoreTest {

@Test
public void whenComparingReferences_thenNotEqual() throws Exception {
Dog fido = new Dog("Fido", 5.15f);
Dog fidosClone = new Dog("Fido", 5.15f);

assertThat(fido).isNotEqualTo(fidosClone);
}

@Test
public void whenComparingFields_thenEqual() throws Exception {
Dog fido = new Dog("Fido", 5.15f);
Dog fidosClone = new Dog("Fido", 5.15f);

assertThat(fido).isEqualToComparingFieldByFieldRecursively(fidosClone);
}

@Test
public void whenCheckingForElement_thenContains() throws Exception {
List<String> list = Arrays.asList("1", "2", "3");

assertThat(list)
.contains("1");
}

@Test
public void whenCheckingForElement_thenMultipleAssertions() throws Exception {
List<String> list = Arrays.asList("1", "2", "3");

assertThat(list).isNotEmpty();
assertThat(list).startsWith("1");
assertThat(list).doesNotContainNull();

assertThat(list)
.isNotEmpty()
.contains("1")
.startsWith("1")
.doesNotContainNull()
.containsSequence("2", "3");
}

@Test
public void whenCheckingRunnable_thenIsInterface() throws Exception {
assertThat(Runnable.class).isInterface();
}

@Test
public void whenCheckingCharacter_thenIsUnicode() throws Exception {
char someCharacter = 'c';

assertThat(someCharacter)
.isNotEqualTo('a')
.inUnicode()
.isGreaterThanOrEqualTo('b')
.isLowerCase();
}

@Test
public void whenAssigningNSEExToException_thenIsAssignable() throws Exception {
assertThat(Exception.class).isAssignableFrom(NoSuchElementException.class);
}

@Test
public void whenComparingWithOffset_thenEquals() throws Exception {
assertThat(5.1).isEqualTo(5, withPrecision(1d));
}

@Test
public void whenCheckingString_then() throws Exception {
assertThat("".isEmpty()).isTrue();
}

@Test
public void whenCheckingFile_then() throws Exception {
final File someFile = File.createTempFile("aaa", "bbb");
someFile.deleteOnExit();

assertThat(someFile)
.exists()
.isFile()
.canRead()
.canWrite();
}

@Test
public void whenCheckingIS_then() throws Exception {
InputStream given = new ByteArrayInputStream("foo".getBytes());
InputStream expected = new ByteArrayInputStream("foo".getBytes());

assertThat(given).hasSameContentAs(expected);
}

@Test
public void whenGivenMap_then() throws Exception {
Map<Integer, String> map = Maps.newHashMap(2, "a");

assertThat(map)
.isNotEmpty()
.containsKey(2)
.doesNotContainKeys(10)
.contains(entry(2, "a"));
}

@Test
public void whenGivenException_then() throws Exception {
Exception ex = new Exception("abc");

assertThat(ex)
.hasNoCause()
.hasMessageEndingWith("c");
}

@Ignore // IN ORDER TO TEST, REMOVE THIS LINE
@Test
public void whenRunningAssertion_thenDescribed() throws Exception {
Person person = new Person("Alex", 34);

assertThat(person.getAge())
.as("%s's age should be equal to 100")
.isEqualTo(100);
}
}
36 changes: 0 additions & 36 deletions core-java-8/.classpath

This file was deleted.

Loading