Questions tagged as 'junit'

3
answers

compare objects in Java?

I'm using Java 8, Netbeans 8.2 and JUnit 4.12. I have two instances of a class that I want to compare to know if they are "equal", where their properties have the same values. That is, if they have id and name, if I write in the test: ass...
asked by 18.07.2018 / 15:54
1
answer

Doubts to check an array in JUnit

I have an Array class with two constructors and some methods like initialize or invert, the problem is that I have tried several things but I do not know how to compare the method with the expected result. I tried this: package test;...
asked by 11.05.2018 / 03:26
1
answer

How to change the value of a mock at run time?

I have the following method: public void ingresarCarga() { Integer idCarga = ingresoDao.ingresar(); ResultadoIngreso resultado; do { resultado = archivoDao.procesar(); try { if(resultado.getCodigo() ==...
asked by 29.05.2018 / 18:36
1
answer

Error in unit tests

I developed a game in Java and I have to do unit tests. I do them and I get an error in the tests but I do not understand why, if the game works as expected. The test code is as follows: package Frames; import org.junit.After; import org.juni...
asked by 25.07.2017 / 06:04
1
answer

Error: Could not instantiate class org.openqa.selenium.chrome.ChromeDriver

This error appears when I run the test. I do not know how to solve it thanks for your help    Could not instantiate new WebDriver instance of type class   org.openqa.selenium.chrome.ChromeDriver import org.junit.Test; import org.junit.runn...
asked by 16.03.2018 / 17:35
0
answers

Integration Test Exercise in JAVA

Test or Integration Test Consider the following Bank class: public class Bank{private Account[] accounts; public Bank(int numAccounts) { accounts = new Account[numAccounts]; } public int getNumberAccounts() { int...
asked by 28.12.2018 / 20:38
1
answer

Selenium IDE and WebDriver

I have started a project of unit tests of a web. For this I have decided to use Selenium, but I have had a series of doubts and problems. Selenium IDE and the WebDriver are on the web, this second one seems to be a little abandoned, and gives...
asked by 26.10.2018 / 08:53
1
answer

Unit Test Spring Boot

I'm doing unit tests for the first time in Spring Boot. It turns out that it shows me an Error: Field cardRepository in ec.com.alquimiasoft.futgolazoback.service.CardService required a bean of type 'ec.com.alquimiasoft.futgolazoback.repository...
asked by 30.10.2018 / 18:39
2
answers

What is the difference between using the JUnit class and using the console to test?

I have used JUnit several times, however, the question I have is, what is the difference between using JUnit and showing something by console? Let's give 1 example, if I wanted to know if I ordered a number arrangement well, the...
asked by 08.10.2018 / 00:54
0
answers

Generate a TestCase (JUnit) where you create a list of a class already made in JAVA

I have a class called "Cost" where I have the following characteristics and methods: public class Costo { int posicion; String NumeroParte; String Descipcion; float monto; int CambioPrecio; //Constructores public Cost...
asked by 03.10.2018 / 23:03