Skip to content

Instantly share code, notes, and snippets.

View mutyonok's full-sized avatar
🍊

Oleksii Lomako mutyonok

🍊
  • TransferWise
  • London
View GitHub Profile
import spock.lang.Specification
class CodeConstraintVerificationSpec extends Specification {
def repository = Mock(List)
def service = new Service(repository)
def "failing test"() {
given:
def entity = new Entity(events: ['test'])
when:
public function batchInsert($table, $columns, $rows)
{
$quotedTable = $this->db->quoteSql($table);
$quotedColumns = [];
foreach ($columns as $column) {
$quotedColumns[] = $this->db->quoteSql($column);
}
$sql = $this->db->getQueryBuilder()->batchInsert($quotedTable, $quotedColumns, $rows);
@mutyonok
mutyonok / gist:4462002
Created January 5, 2013 15:02
test for non-string keyed map with references in morphia
public class MapWithNonStringKeyAndReferenceValueTest extends ProxyTestBase {
@Test
public void testMapKeyShouldBeInteger() throws Exception {
morphia.map(ChildEntity.class, ParentEntity.class);
ChildEntity ce1 = new ChildEntity();
ce1.value = "first";
ChildEntity ce2 = new ChildEntity();
ce2.value = "second";