Questions tagged as 'junit'

1
answer

How to get access to onView, withId or matches methods on Android?

I'm following this tutorial! In it, display this example: package com.example.android.testing.espresso.BasicSample; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import android.s...
asked by 21.01.2016 / 17:17
1
answer

How to test the creation of an obj and method call in a servlet?

I am trying to create a web application using TDD, however, I am having a question about how to test the Servlet that processes the requests and calls the proper logic, I do not know how to do assert . @Test public void deveCriarInstacia...
asked by 11.06.2014 / 15:49
0
answers

How do I test this Spring MVC method with JUnit? [closed]

Hello, I need help to create a JUnit test class for the Spring method below. @Controller public class ControllerFuncionario { @RequestMapping("/index") public String index(Funcionario funcionario, Project pro, Model model) {...
asked by 24.12.2018 / 13:37
1
answer

Enable Flash Player with JUnit

Good afternoon. I'm trying to enable Adobe Flash Player in Chrome's Headless, but I'm not getting it. Follow my code: public class testes { @Test public void inicializa() { ChromeOptions options = new ChromeOptions();...
asked by 03.12.2018 / 17:59
0
answers

How do I make selenium (jUnit) switch between open windows?

When I click the button, the browser opens a new window, I look for the element in the open window and can not find it. I think he has not changed to the new window and is still looking at the old window. Error:    org.openqa.selenium.NoSu...
asked by 31.10.2018 / 13:44
1
answer

How to implement deletion in Junit with Spring Boot?

I need to know how to implement registry exclusion through Junit (Unit Testing) with Spring Boot, I'm having difficulty, the inclusion is working as you can see below; @Autowired private PessoaRepository pessoaRepository; @Autowired...
asked by 02.11.2018 / 13:23
0
answers

How do I inject EJB's that call other EJB's in a JUnit test class?

I'm trying to test a class in JUnit. It turns out that the class I am testing has several EJB's that call other EJB's. How do I inject JUnit EJBs into a test class that calls other EJB's? Thank you.     
asked by 10.10.2018 / 17:20
0
answers

How to have several exception classes in Junit Spring Boot?

I would like to have several exception classes in this code snippet below, but I'm just getting one, how do I put multiple exception classes? @Test(expected = NameProjectEmployeeCadastradoException.class) I tried it that way, it did not wo...
asked by 19.09.2018 / 20:40
0
answers

When I'm running JUnit the RestController does not accept JSON

I'm trying to do a test with MockMVC in my application, however, when I run the test it always gives this error: org.springframework.web.HttpMediaTypeNotSupportedException I noticed that when it is in scope of tests, the controller does no...
asked by 17.08.2018 / 15:35
0
answers

Problem with #language: pt in Gherkin - Eclipse Photon

Everyone, how are you? Next, I'm trying to write a .feature in Portuguese but the recommended #language: pt did not work, which I have done so far: 1 - I saw on the net that version 3.0 of Gherkin.jar resolved, I downloaded but gave an err...
asked by 04.08.2018 / 17:34