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 java.util.List; | |
import java.util.function.Consumer; | |
import java.util.stream.Stream; | |
import static java.util.stream.Collectors.toList; | |
import static org.junit.Assert.fail; | |
@SuppressWarnings("unchecked") |
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
private Matcher<ErrorCollector> containsErrorCode(final ErrorCode errorCode) { | |
return new BaseMatcher<ErrorCollector>() { | |
@Override | |
public boolean matches(final Object item) { | |
ErrorCollector allErrors = (ErrorCollector) item; | |
FieldError fieldError = allErrors.getFieldError(errorCode.getField()); | |
if (fieldError == null) { | |
return false; | |
} | |
if (!fieldError.getCode().equals(errorCode.getCode())) { |
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
private Matcher<ResponseEntity<String>> httpStatus(final HttpStatus httpStatus) { | |
return new BaseMatcher<ResponseEntity<String>>() { | |
@Override | |
public boolean matches(final Object item) { | |
final ResponseEntity<String> responseEntity = (ResponseEntity<String>) item; | |
return httpStatus.equals(responseEntity.getStatusCode()); | |
} | |
@Override | |
public void describeTo(final Description description) { |
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
Mutant configuration: | |
Matcher: #<Mutant::Matcher::Config match_expressions: [SafeCommitHook]> | |
Integration: Mutant::Integration::Rspec | |
Jobs: 1 | |
Includes: ["lib"] | |
Requires: [] | |
(00/932) 100% - killtime: 0.00s runtime: 0.00s overhead: 0.00s | |
(00/932) 100% - killtime: 0.00s runtime: 0.00s overhead: 0.00s | |
(00/932) 100% - killtime: 0.00s runtime: 1.01s overhead: 1.01s | |
(04/932) 100% - killtime: 1.66s runtime: 2.01s overhead: 0.35s |
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
// Current Implementation - Using FirefoxDriver | |
@Before | |
public static void before() { | |
driver = new FirefoxDriver(); | |
admin = new AdminApi(); | |
user = new UserApi(driver); | |
screen = new ScreenApi(driver); | |
} |
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 org.reflections.Reflections; | |
import javax.persistence.Entity; | |
import java.lang.reflect.Method; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.stream.Collectors; |
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 SanityDbComponentTest { | |
@Test | |
public void foo() throws Exception { | |
Reflections reflections = new Reflections("com.sonicdrivein"); | |
Set<Class<?>> classes = reflections.getTypesAnnotatedWith(Entity.class); | |
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 foo() throws Exception { | |
// find all classes that extend CrudRepository | |
// find the object that the repository is for | |
// check that object has .getCreatedAt and .getUpdatedAt with the Timestamp type | |
// https://stackoverflow.com/questions/492184/how-do-you-find-all-subclasses-of-a-given-class-in-java | |
// ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true); | |
// provider.addIncludeFilter(new AssignableTypeFilter(CrudRepository.class)); | |
// |
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 DependencyResolver | |
COMMAND = "rm -rf Gemfile.lock ; bundle install ; ruby lib/foo.rb 2>&1" | |
LOCKED_GEM = /.*locked to (.*)\, but.*/ | |
NOT_FOUND_GEM = /.*Could not find (.*) in any.*/ | |
ADD_GEM_TO_GEMFILE = 1 | |
def initialize | |
end | |
def run |
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 com.google.common.collect.Lists; | |
import io.swagger.models.Operation; | |
import io.swagger.models.Path; | |
import io.swagger.models.Swagger; | |
import io.swagger.models.parameters.BodyParameter; | |
import io.swagger.models.parameters.Parameter; | |
import io.swagger.parser.SwaggerParser; | |
import org.hamcrest.Matcher; |