This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from("file:pedidos?delay=5s") | |
.multicast() | |
.to(direct:soap) | |
.to(direct:http) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from("file:pedidos?delay=5s&noop=true") | |
.to("direct:http") | |
.to("direct:soap") | |
from("direct:http") | |
.setProperty("pedidoId", xpath("/pedido/id/text()")) | |
.split() | |
.xpath("/pedido/itens/item") | |
.to("http://localhost") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RotaPedidos { | |
public static void main(String[] args) throws Exception { | |
CamelContext context = new DefaultCamelContext(); | |
context.addRoutes(new RouteBuilder()) { | |
@Override | |
public void configure() throws Exception { | |
from("file:pedidos?delay=5s") | |
.log("${id}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import java.util.concurrent.TimeUnit; | |
import org.junit.Assert; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.ChromeDriver; | |
public class TaskTest { | |
@Test | |
public void deveSalvarTarefaComSucesso() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import io.restaassured.RestAssured; | |
public class deveRetornarTarefas { | |
@Test | |
public void test() { | |
RestAssured.given(). | |
.when().get(“http://localhost:8001/tasks-backend/todo””) | |
.then().statusCode(400) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import io.restaassured.RestAssured; | |
public class deveRetornarTarefas { | |
@Test | |
public void test() { | |
//no given nos informamos algumas pré condições, when é quando executamos //determinada ação e then ele começa a fazer as assertivas. Vamos retornar o //status 400 para as tarefas. | |
RestAssured.given(). | |
.when().get(“http://localhost:8001/tasks-backend/todo””) | |
.then().statusCode(400) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(Parameterized.class) | |
public class CalculoValorLocacaoTest { | |
private LocacaoService service; | |
@Parameter | |
public List<Filme> filmes; | |
@Parameter(value=1) | |
public Double valorLocacao; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Rule | |
public ExpectedException exception = ExpectedException.none(); | |
@Test | |
public void testLocacao_filmeSemEstoque_3() throws Exception { | |
// cenario | |
LocacaoService service = new LocacaoService(); | |
Usuario usuario = new Usuario("Usuario 1"); | |
Filme filme = new Filme("Filme 1", 0, 5.0); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testLocacao_filmeSemEstoque_2(){ | |
// cenario | |
LocacaoService service = new LocacaoService(); | |
Usuario usuario = new Usuario("Usuario 1"); | |
Filme filme = new Filme("Filme 1", 2, 5.0); | |
// açao | |
try { | |
service.alugarFilme(usuario, filme); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test(expected=Exception.class) | |
public void testLocacao_filmeSemEstoque() throws Exception { | |
// cenario | |
LocacaoService service = new LocacaoService(); | |
Usuario usuario = new Usuario("Usuario 1"); | |
Filme filme = new Filme("Filme 1", 2, 4.0); | |
// açao | |
service.alugarFilme(usuario, filme); | |
} |
NewerOlder