Questions tagged as 'junit'

0
answers

Selenium opening two browsers even I instantiating only one

Galera, I'm using Cucumber with Selenium in JAVA. I have the following problem: at each step I do: private WebDriver driver; @Before public void before(){ driver = new FirefoxDriver(); } @Given("^something$) public void someGivenMehtod(...
asked by 26.07.2016 / 15:43
1
answer

Test main class input method with Systemin snapping in test class

How do I test the System.out.println () method? The method I want to test displays the phrase:    Enter the name > How do I test if this sentence was changed or not changed in the Test class? Main class: public class Cliente exten...
asked by 07.04.2016 / 15:35
0
answers

How does mock in integration tests work? [closed]

How to use mock in my integration tests?     
asked by 07.10.2015 / 18:59
0
answers

Selenium / JUnit - Authentication screen is not written / executed

I'm doing a POC to use Selenium + JUnit 4 for functional interface testing on a web tool. The tool in question requires authentication when the URL is opened, and the test has been written to Selenium IDE / Firefox with all steps including compl...
asked by 26.01.2015 / 19:13
1
answer

How to include the unit test artifacts in a simple Java application?

This is my project in my repository; DESIGN Look at the pom.xml file <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc...
asked by 26.12.2018 / 20:31
1
answer

How to get the result of a JUnit assertEquals test and why in a String type variable?

I'm having a JUnit test case to test a simple class. The class to be tested contains only one "sum" method that adds two numbers. To test if it is correct, I use the following method: Assert.assertEquals(2, meu_objeto.sum(1, 2)); The resu...
asked by 25.04.2016 / 18:53
1
answer

Error: RuntimeException when trying to mount test case

I'm trying to set up a simple test using espresso and the following errors appear: Code:importandroid.content.Context;importandroid.os.Bundle;importandroid.support.annotation.Nullable;importandroid.support.test.InstrumentationRegistry;import...
asked by 25.08.2016 / 19:05
1
answer

Error executing an assert in eclipse

I have the following lines: import static org.junit.Assert.*; import org.openqa.selenium.WebElement; public class ClasseTeste extends Navegadores { public static void verificarTitulo() { abrirChrome(); String titulo = driver.getT...
asked by 11.08.2014 / 21:31
1
answer

How to do the unit test of Spring Boot insert the data in the Bank?

I created a simple system that is working perfectly, but I need to implement a unit test in Spring Boot, which happens when I test or I can not enter the data in the database or it generates error; I tried this way, did not generate error, bu...
asked by 19.09.2018 / 14:32
1
answer

Classes Parametrizadas with JUnit 4

I have an exercise to solve involving classes parameterized in Java and I'm a bit confused. The exercise is as follows:    Program a parameterized class to   test the areaA square method with the following   input and output values: {b:0...
asked by 08.03.2018 / 03:00