Skip to content

Instantly share code, notes, and snippets.

View vcatalano's full-sized avatar

Vincent Catalano vcatalano

  • Salus Fintech
  • Tucson, AZ
View GitHub Profile
public class RegistrationExampleServiceTest {
@Rule
public DBITestRule database = new DBITestRule();
@Test(expected = RegistrationException.class)
public void testUserRegistration() throws RegistrationException {
UserDAO userDAO = database.getDbi().onDemand(UserDAO.class);
RegistrationExampleService service = database.getDbi().onDemand(RegistrationExampleService.class);
@vcatalano
vcatalano / RegistrationExampleService.java
Created March 10, 2017 19:54
Simple registration service using a JDBI Transaction.
import com.example.exceptions.RegistrationException;
import com.example.User;
import com.example.UserRole;
import com.example.AccountDAO;
import com.example.UserDAO;
import com.example.UserRoleDAO;
import org.skife.jdbi.v2.sqlobject.CreateSqlObject;
import org.skife.jdbi.v2.sqlobject.Transaction;
/**
importPackage(java.io);
(function(args) {
var templateFileExtension = 'handlebars',
output = ['// This file is auto-generated and should be ignored from version control.\n'],
console = {
log: print
},
showUsage = function() {
console.log('Usage: java -jar <rhino.jar> rhino-handlebars-compiler.js --handlebars <handlebars library path> --templates <templates directory> --output <output file>');
importPackage(java.io);
(function(args) {
var templateFileExtension = 'handlebars',
output = ['// This file is auto-generated and should be ignored from version control.\n'],
console = {
log: print
},
showUsage = function() {
console.log('Usage: java -jar <rhino.jar> rhino-handlebars-compiler.js --handlebars <handlebars library path> --templates <templates directory> --output <output file>');