Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!

Nemanja Milosavljević

Greenhorn
+ Follow
since Mar 04, 2020
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nemanja Milosavljević

Yes that was a problem from the link,
I just managed to solve this morning and couldn't answer.
The problem was with the mySql engine.
By default, it was a myISAM that does not support transactions and had to be changed to the InnoDb engine.
Thanks anyway .
3 weeks ago
Hi, I'm doing an integration test in the spring and I have a problem where during the addition test in the service, rollback not working, but always add an item to the base.
I have annotation @ Transactional and @ TestPropertySource on test class,
I have application-test.properties and the test is successful but the rollback is not executed and a new item is always added to the test database.


My test class and add test method (last one):



My application-test.properties :



And when execute add address test, every time in my kts_test data base ( db used for testing) is added new item and not rollback.

If anyone can help I would be grateful. Thank you.
3 weeks ago
Hello, I'm new in unit testing, so I'd like to ask how I can test the following method.

The method is a little messy, but it works and returns the user who is currently logged in. I'm asking how to test it, otherwise I use a MockitoJUnitRunner to test spring application unit tests.

If anyone can post an example or a advice I would be very grateful. Thanks.

3 weeks ago