Skip to content

Instantly share code, notes, and snippets.

View mauricioaniche's full-sized avatar

Maurício Aniche mauricioaniche

View GitHub Profile
## Spring Boot testing guidelines
When adding or changing tests in this Spring Boot application, prefer behavior-focused component tests over isolated unit tests. Tests should exercise the application the way production code is invoked, while keeping external dependencies controlled.
### Test from the system boundary
- Tests for request-driven behavior must start from a controller endpoint.
- Do not create isolated tests for services, entities, repositories, mappers, validators, or other classes that are reachable through an endpoint.
- A service class should be covered through controller tests that trigger the service through the HTTP/API boundary.
- Entity behavior, validation, persistence mappings, repository queries, and transactional behavior should be exercised as part of controller-driven tests whenever the behavior is reachable from an endpoint.
BASE_NAME = paper
INPUTS = $(wildcard *.tex) *.bib
LATEX = latex
PDFLATEX = pdflatex
BIBTEX = bibtex
MAKEINDEX = makeindex
pdf: $(BASE_NAME).pdf
ps: $(BASE_NAME).ps
# @ -> our hero
# G -> ghosts
# P -> pills
# . -> empty spaces
# | and - -> walls
map = [
"|--------|",
"|G..|..G.|",
"|...PP...|",
"|G...@.|.|",
# @ -> our hero
# G -> ghosts
# P -> pills
# . -> empty spaces
# | and - -> walls
map = [
"|--------|",
"|G..|..G.|",
"|...PP...|",
"|G...@.|.|",
# @ -> our hero
# G -> ghosts
# P -> pills
# . -> empty spaces
# | and - -> walls
map = [
"|--------|",
"|G..|..G.|",
"|...PP...|",
"|G...@.|.|",
import com.github.javaparser.StaticJavaParser;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.expr.MethodCallExpr;
import com.github.javaparser.ast.visitor.ModifierVisitor;
import com.github.javaparser.ast.visitor.Visitable;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import com.github.javaparser.StaticJavaParser;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.expr.MethodCallExpr;
import com.github.javaparser.ast.visitor.ModifierVisitor;
import com.github.javaparser.ast.visitor.Visitable;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.HashSet;
import com.github.javaparser.StaticJavaParser;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.expr.MethodCallExpr;
import com.github.javaparser.ast.visitor.ModifierVisitor;
import com.github.javaparser.ast.visitor.Visitable;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Set;
public static void main(String[] args) throws FileNotFoundException {
CompilationUnit cu = StaticJavaParser.parse(new FileInputStream("/Users/mauricioaniche/workspace/logremoval/fixture/A.java"));
cu.accept(new ModifierVisitor<Void>() {
@Override
public Visitable visit(final MethodCallExpr n, Void arg) {
boolean isALogClass = n.getScope().isPresent() && (logClasses.stream().anyMatch(x -> n.getScope().get().toString().startsWith(x)));
boolean isALogMethod = logMethods.contains(n.getName().asString());
@mauricioaniche
mauricioaniche / queen8.py
Last active September 30, 2019 15:27
Brute force implementation of the eight queens problem
def bf_queen(m):
return bf_queen_rec(m, 0)
def check(r, v):
pos_1, pos_2 = v, v
for j in r:
pos_1 = pos_1 - 1
if m[j] == pos_1:
return False