Questions tagged as 'junit'

2
answers

Doubt in a Java exercise [closed]

I was looking for some Java exercises to train and learn some algorithms when I came across the site exercism.io and I decided to do their exercises in Java. So far so good, I downloaded their app using chocolately and installed the gradle...
asked by 17.01.2016 / 23:08
1
answer

Error using Mock: Wanted but not invoked: Actually, there were zero interactions with this mock

I am making a list of exercises and I am in doubt about the following:    Exercise 3 - The verify method, from the org.mockito.Mockito.verify package, is   used to check the amount of times a method is invoked.   Add in the ATest class a test...
asked by 01.04.2018 / 05:23
3
answers

How to test the Service layer in a web service application, using mockito and junit

I have a class of services that will receive a dependency injection of an object responsible for the persistence layer. In this service class are all my methods that will respond to the REST call of the web service. The problem is: I would...
asked by 06.09.2014 / 17:12
0
answers

How to make a mock in an android class at runtime?

I'm having a hard time testing, I was wondering if there is a possibility to simulate a custom return in a runtime method example: @RunWith(JUnit4.class) public class TesteSmile { UserAndPass userAndPass = new UserAndPass(); @Rule...
asked by 07.08.2018 / 19:14
0
answers

Fill field CPF + Date with mask selenium webdriver java [closed]

I am having difficulty populating Date and CPF fields with masquerade through id or xpth in selenium + java + JUnit. Does anyone have an idea how to do it? NOTE: I do not want to generate CPF ... I want to fill field.     
asked by 29.07.2015 / 20:03
1
answer

Demoiselle 2.4.0: Error executing test with JUnit

I have a project built from the Demoiselle archetype for Maven . The generated application is the one that exemplifies the Demoiselle, containing a register of bookmarks . The developer who generated zero revision of the application is no...
asked by 18.12.2014 / 14:41
1
answer

How to change the language of exceptions thrown during automated testing

Using Eclipse (IBM RAD Studio), Maven, and JUnit, when an exception is thrown while running tests the message is displayed in Portuguese. I would like it to be shown in English. Example: org.apache.openjpa.persistence.ArgumentException:...
asked by 04.09.2014 / 22:28
2
answers

Execution does not find 'org.junit.Assert' even though JUnit jar is in classpath

I have a problem that I have researched a lot and still have not found the answer. I have a test case that I'm trying to run and send a message to the console. But even with JUnit jars, he accuses them as if he did not find them. I'm having a ma...
asked by 01.07.2016 / 01:08
2
answers

Test without "messing up" (adding data) to the database

I'm having trouble doing integration testing. I test my database functions. My web application does not use any framework database connection and I am not able to do tests without messing up my database. I would like to know how to test wit...
asked by 29.01.2016 / 19:26
1
answer

How to use JUNIT to test void methods of my DAO class

Hello, I have a DAO class and I want to implement tests with JUNIT, but many of the methods have a void return. Here's a piece of the class that makes up the DAO package public class ExemplarDAO { private Connection connection = null; publi...
asked by 22.11.2016 / 16:02