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 com.mysql.cj.protocol; | |
import com.mysql.cj.conf.PropertyDefinitions; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Method; | |
import java.net.InetSocketAddress; | |
import java.net.Socket; |
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 lombok.extern.slf4j.Slf4j; | |
import org.springframework.web.util.UriComponentsBuilder; | |
import java.net.URI; | |
import java.util.Optional; | |
import static java.lang.String.join; | |
import static java.util.Arrays.asList; | |
/** |
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
<plugin> | |
<groupId>com.github.searls</groupId> | |
<artifactId>jasmine-maven-plugin</artifactId> | |
<version>3.0-alpha-01</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>test</goal> | |
</goals> | |
</execution> |
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
@Aspect | |
@Component | |
public class SampleControllerAspect { | |
private static final Logger LOGGER = LoggerFactory.getLogger(SampleControllerAspect.class); | |
@Around("execution(* br.com.globo.controller.SampleController.sample(String)) && args(honestSampleHeader)") | |
public ModelAndView aroundWallMethod(ProceedingJoinPoint proceedingJoinPoint, String honestSampleHeader) throws Throwable { | |
LOGGER.debug("What was intercepted: {}", honestSampleHeader); |
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
@Controller | |
public class SampleController { | |
private static final Logger LOGGER = LoggerFactory.getLogger(SampleController.class); | |
@Autowired | |
private SampleService sampleService; | |
@GetMapping(REQUEST_PATH_SAMPLE) | |
public ModelAndView sample(@RequestHeader(HONEST_SAMPLE_HEADER) String honestSampleHeader) { |
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
describe("Regras para atender demandas específicas de testes honestos", () => { | |
var sampleJasmineController; | |
beforeEach(() => { | |
ScenarioBuilder.prepareView(); | |
sampleJasmineController = new SampleJasmineController(); | |
}); |
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
@PostMapping(path = REQUEST_PATH_JASMINE, produces = APPLICATION_JSON_VALUE) | |
public ResponseEntity<?> jasmine(@RequestParam(HONEST_JASMINE_AJAX_PARAMETER) Optional<String> sample) throws InterruptedException { | |
var maybeEmptySample = sample.map(s -> s.isEmpty()? null : s); | |
LOGGER.info("Looking for {}", maybeEmptySample); | |
TimeUnit.SECONDS.sleep(2); | |
return ok(new Object() { |
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
<!DOCTYPE html> | |
<html xmlns:th="http://www.thymeleaf.org"> | |
<head> | |
<title>Jasmine Honesto</title> | |
<meta charset="utf-8"/> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1"/> | |
</head> | |
<body> |
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
class SampleJasmineController { | |
constructor(serviceUrl) { | |
let $ = document.querySelector.bind(document); | |
this._service = new SampleJasmineService(serviceUrl); | |
this._message = $('p.message'); | |
this._btnSubmit = $('form input[type=submit]'); |
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
class SampleJasmineService { | |
constructor(serviceUrl) { | |
this._http = new HttpService(); | |
this._servicoUrl = serviceUrl; | |
} | |
consult(message) { |