Sometimes a method you want to test is private and cannot be called directly from a junit test. Of course
WeiterlesenKategorie: Java
Simple test with Spring services and mocks
This is a sample how to use mocks in a junit test class:
WeiterlesenMocking a Spring service with Mockito for a JUnit test
First define the bean to be mocked in your XML like this Then you can inject it into other beans
WeiterlesenLogging SQL-Statements with IBatis on Wildfly
Depending on what you want to see, you can enable logging for iBATIS in your logging configuration like this: iBATIS
WeiterlesenCapture arguments from a mocked service call
If you like to get the arguments of a mocked service call SERVICEMETHOD you can use this Now you can
WeiterlesenDefine Spring Beans inline JUnit test
Sometimes you like to define some Spring beans in a JUnit test and do not want to create extra files
WeiterlesenReset Mocks before every test
Some mocks may need a reset before the test is run. Especially if the same one is used in several
WeiterlesenParse double from string with dot or comma
Sometimes it is not clear which decimal seperator is used. You can have a dot or a comma without knowing
WeiterlesenCreate BigDecimal from double
If you create a BigDecimal from a double value you should not use the contructor of BigDecimal: Because of the
Weiterlesen