Questions tagged as 'junit'

0
answers

How to use junit to test jax rs on wildfly

I created the following test to validate the register but instead of returning 201 with the created resource is generating this generic error. My DAO is working alone in a normal way (I created a list address using it) Would you have any clue wh...
asked by 11.06.2018 / 19:10
1
answer

Test RMI with JUnit

How to test a client / server application using RMI with JUnit? I've researched a myriad of places and found nothing that would help me.     
asked by 28.10.2015 / 09:00
1
answer

Methods for testing Spring application are not found

I'm following the following article: Introduction To Spring MVC Test Framework I have the following code: this.mockMvc.perform(get("/product/1")) .andExpect(status().isOk(). .alwaysExpect(content().contentType("application/json;charset=UT...
asked by 18.02.2016 / 12:16
1
answer

How to test a DAO (using Spring and JPA) outside a container?

I'm developing an application with JPA 2, Spring and JSF 2 running in WildFly 8.0.0. I have already developed some previous applications following the same specification but never tested properly using jUnit. Now, I would like to change that and...
asked by 31.03.2014 / 20:26
1
answer

How to support transactions with JUnit and Demoiselle 2.4.2

I have an application whose unit tests are in full operation, except for write operations in the database. No data is recorded. When forcing a flush, I got the message stating that no transaction was in progress, even though the BusinessControll...
asked by 01.02.2017 / 14:34
1
answer

Calculate delta value for assertEquals in JUnit

Greetings. What is the best way to calculate JUnit's assertEquals (message, expected, current, delta) delta value?     
asked by 18.04.2016 / 21:09
2
answers

Develop integration tests correctly

We are writing several tests for the application, there is testes unitários and we start testes de integração . All communication with DAO is mockada, but when I test the API, should I test the cases that have already been tested...
asked by 01.06.2015 / 13:43
1
answer

Run unit tests with dependencies that are in the exclusions group

I have a scenario where I need to run a test with JUnit on a feature that has an external dependency, but to run this functionality on the application server I need to put this external dependency in the exclusions group on my pom.xml ....
asked by 30.10.2014 / 12:33
1
answer

Are the unit tests correct?

I'm participating in a selective process, and one of the criteria is to implement any kind of unit testing, I just want to know if it's implemented right the code below, it's working perfectly, I just need to know if it's implemented right. p>...
asked by 02.11.2018 / 16:47
1
answer

Mockar non-static method of a class containing a call from another static method

Hello, The title was a bit confusing, but come on. I have the class below: public class ClasseA { public static final int constA = ClasseB.metodoB(); public int metodoA(){ System.out.println("Passei no metodo A");...
asked by 15.01.2018 / 11:41