java


Spring, JUnit, Hibernate Testing


Can someone point me out to a good source of information on Spring mvc testing? I would like to test:
Entities: I want to be able to create a new record in the database, fetch all records and assert on the new elements count.
#Controllers: I would like to be able to simulate a get, post or put to a specific path and get it reach the #Controller by simulating RequestBody
Services: I would like to be able to call autowired services from JUnit tests and perform operations on entities.
In other words, I come from Rails and am trying to understand Spring way of testing, preferrably without Mocking anything...
You should read the Spring MVC Test project: https://github.com/spring-projects/spring-test-mvc
Remember it is still in the attic.
Note from #ChristianMuller:
Entities: In case you are interested in an Spring/Hibernate/JUnit In-Memory solution, have a look at this: http://tshikatshikaaa.blogspot.de/2012/09/junit-testing-spring-service-and-dao.‌​html
A great source is the spring framework documentation
Entities: Usually in Spring Entities are simple POJOs, so in this case what you really want to do is test the Repositories.
Services: Nothing special here, services can easily be tested either in the Spring context or using mocking to mock dependencies.
Controllers: Since Spring 3.2, Spring MVC testing was added to the project.

Related Links

Null Pointer Error: Can't Find Declaration Cause
Settings for RS232 serial port communication
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? WHERE userid [duplicate]
Convert List to Map and filter null keys
Assigning a Unicode character with a size of 4 bytes to a char
Which directory should I run mvn from and what does it do?
ExecutorService schedule single task only
Weird error uploading file with Spring Web Flow
How to add a button to freeze and resume the bouncing ball JAVA
Tokenizing a String in Java
gson serialization and deserialization of an ArrayList<object>
Java swing Jlist creation
How to replace the value of '0' in a given pattern?
Java Swing create a Text Area for the Output
Smooth animation (Java SWT)
How to dismiss the keyboard in appium using Java?

Categories

HOME
multithreading
proxy
pycharm
angular-material
smarty
iterator
hp-exstream
electron
read-eval-print-loop
kalman-filter
sqlite-net-extensions
elm
win32gui
retrofit
acquia
basic
modx-revolution
percona
dosgi
django-admin
pc
windows-7-x64
propel
ab-testing
shared-hosting
dcevm
tapestry
apache-commons-io
nhapi
directx-10
google-cloud-endpoints-v2
oracle-fusion-middleware
mapbox-gl
restlet
qwerty
reportbuilder
lumberjack
user-controls
dism
email-templates
ensembles
sfdc
dynamic-reports
janrain
password-encryption
outlook-api
hendrix
clean-architecture
dandelion
pebble-watch
magma
sybase-asa
python-cryptography
log4c
phishing
rvest
yaws
apachebench
independentsoft
jms2
cartesian-product
eclipse-clp
marching-cubes
qdialog
atk4
varargs
map-projections
interrupted-exception
nsight
proj4js
gwidgets
codeigniter-url
android-imagebutton
funcunit
jquery-layout
xceed-datagrid
seaside
datagridviewcolumn
industrial
prettify
jsctypes
.aspxauth
easy-install
qt-faststart
padarn
http-unit
android-hardware
angularjs-controller
rdoc
bluepill
first-responder
windows-phone-7.1.1
buildr
asyncfileupload
nsdatecomponents
fireworks
php-parser
vdsp
gcj
gallio
xsdobjectgen
nsviewanimation
fixed-width
substrings
mtj
sustainable-pace
putchar
mdac
data-acquisition
paul-graham

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile