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
package boothello; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
public class HelloController { | |
@RequestMapping("/") | |
public CustomResponse index() { |
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
package boothello; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
@SpringBootApplication | |
public class Application { | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); |
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
<?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:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>curso-spring</groupId> | |
<artifactId>hello-world-spring-boot</artifactId> | |
<version>1.0-SNAPSHOT</version> |
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
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
@Grapes( | |
@Grab(group='com.restfb', module='restfb', version='1.6.12') | |
) | |
import com.restfb.DefaultFacebookClient | |
import com.restfb.json.JsonObject | |
import com.restfb.types.FacebookType | |
import com.restfb.Parameter | |
import com.restfb.BinaryAttachment | |
import java.io.FileInputStream |
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
@Grapes( | |
@Grab(group='com.restfb', module='restfb', version='1.6.12') | |
) | |
import com.restfb.DefaultFacebookClient | |
import com.restfb.Parameter | |
import com.restfb.types.* | |
def token = "FACEBOOK_AUTH_TOKEN" | |
def page_id = "PAGE_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
@Entity | |
@Table(name = "miniblog_comment") | |
@SuppressWarnings("serial") | |
public class MiniblogComment implements Serializable, EntityParent { | |
/** | |
* Attribute commentId. | |
*/ | |
private String commentId; | |
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
if (tieneElUsuarioFondos){ | |
pasarelaDePago.cobrar(elPrecioDeLaCompra); | |
pasarelaDePago.confirmar(); | |
} |
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 CompraTestSpies { | |
PasarelaDePago pasarelaDePagoSpy = mock(PasarelaDePago.class); | |
Producto unProductoStub = mock(Producto.class); | |
Compra compra = new Compra(pasarelaDePagoSpy); | |
@Test public void | |
si_el_cliente_tiene_fondos_para_realizar_la_compra_tengo_que_cobrarle_a_traves_de_la_pasarela_de_pago() { | |
when(unProductoStub.precio()).thenReturn(50); | |
when(pasarelaDePagoSpy.tieneElUsuarioFondosPorValorDe(50)).thenReturn(false); |
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
boolean confirmar() { | |
int elPrecioDeLaCompra = precio(); | |
boolean tieneElUsuarioFondos = pasarelaDePago.tieneElUsuarioFondosPorValorDe(elPrecioDeLaCompra); | |
if (tieneElUsuarioFondos){ | |
pasarelaDePago.cobrar(elPrecioDeLaCompra); | |
} | |
return tieneElUsuarioFondos; | |
} |
NewerOlder