Questions tagged as 'junit'

0
answers

How to improve unit test with junit? Help

I have the following method in my controller that sends a call to a prop class to manage the file download ArchivoUtils.generaArchivo(response, factList); @RequestMapping(value="view/obtieneArchivo") public void obtieneArchivo(...
asked by 10.07.2018 / 04:52
1
answer

Java unit test help

I am not sure if a unit test can be implemented on a method whose result is variable in time. This doubt is based on the fact that I have a method that receives a LocalDate and returns a String with the date in "dd / mm / yyyy" format. To...
asked by 29.06.2018 / 19:04
1
answer

NullPointerException in JUnit5

I am trying to test some methods crud in Spring, and I always get an error in all the tests of NullPointerException in the Party p no matter how I instancer (both with the empty constructor and with the attributes). I have instantiated the match...
asked by 30.05.2018 / 12:12
1
answer

Spring Boot and Mockito

I am trying to solve a problem that I have in spring boot and unit tests with mockito. In my test I am making 2 mocketed http calls to deal with the answers // -----------------------------------------------------------services @Inject...
asked by 25.04.2018 / 09:39
0
answers

Spring MVC IT Test fails because it can not find the HTML page to return

I am trying to do Integration Test (JUNIT) on a webapp with Maven + Spring 5 + thymeleaf and, when I launch the following test: MockHttpServletRequestBuilder createMessage = get(prueba/alta).secure(true) .contentType(MediaType....
asked by 02.04.2018 / 19:23
0
answers

Problem making text JUnit in textsfield

Good, I have a question for a test in JUnit . I do not know how to perform a test in my code that tells me that they can only enter a number in my textfield. I pass the code of what I have done. @Test public void testHandleSalir() throws Exc...
asked by 02.04.2018 / 15:38
0
answers

Ant task runs ignored tests (@Ignore)

Holas In my build.xml I have the integration-test task which runs my integration tests. The problem is that when I execute the task, it also runs the tests with the @Ignore tag, which should not run.} This is the target of the build.xml...
asked by 22.03.2018 / 22:11
0
answers

JUnit Test. NullPointerException in @Inject of the interface

My problem is as follows. I have a Java application whose beans I annotated with @Named and to do the dependency injection between those beans (whether @Controller, @Services ...) I use the @Inject notation. So far so good. The problem com...
asked by 28.03.2018 / 11:50
0
answers

how to test for nested classes?

I just start with this @test, someone could help me with just one example for the next case, because within the coverage also asks me to cover this class, and try several things but not. THANK YOU public class MappersVars{ private MappersVar...
asked by 16.02.2018 / 23:30
2
answers

Run sequential test cases in the same browser Selenium Webdriver

Good day for everyone, I have a question about using selenium webdriver, and I would like to know how I can run test cases sequentially without closing the browser, for example: Suppose I have the following test cases: 1. Login 2. Create Orde...
asked by 06.02.2018 / 19:39