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
// Get all transactions for customers into one list |
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.majan.admintools.api.domain; | |
import com.majan.admintools.api.common.ValidationResult; | |
import org.junit.jupiter.api.DisplayName; | |
import org.junit.jupiter.api.Test; | |
import static com.majan.admintools.api.domain.ContactNumbers.newNumbersList; | |
import static com.majan.admintools.api.domain.VehicleOwner.*; | |
import static org.hamcrest.MatcherAssert.assertThat; | |
import static org.hamcrest.Matchers.is; |
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
@DisplayName("Vehicle Owner") | |
class VehicleOwnerTest { | |
@Test | |
@DisplayName("Should be created with minimum information (First Name, Last Name and Contact Number).") | |
public void shouldBeCreatedWithMandatoryFieldsAreGiven() { ... } | |
@Test | |
@DisplayName("Should not have null or empty first name.") | |
public void shouldBeInvalidIfFirstNameIsNullOrEmpty() { ... } |
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
def commiterDetails = bat ( | |
script: 'git --no-pager show -s --format=%%ae', | |
returnStdout: true | |
) | |
def commiter = extractCommiterEmail(commiterDetails) | |
def extractCommiterEmail(details) { | |
def arr = details.tokenize('\n') |
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
committerEmail = sh ( | |
script: 'git --no-pager show -s --format=\'%ae\'', | |
returnStdout: true | |
).trim() |
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 AdminToolsVerticle extends AbstractVerticle { | |
@Override | |
public void start(Future<Void> fut) throws Exception { | |
Router router = Router.router(vertx); | |
JdbcUtil.initialize(vertx); | |
VehicleOwnerRoute.initialize(router); |
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 VehicleOwnerRoute { | |
public static void initialize(Router router) { | |
router.route("/api/vehicleowners*").handler(BodyHandler.create()); | |
router.post("/api/vehicleowners").handler(VehicleOwnerRoute::create); | |
} | |
public static void create(RoutingContext routingContext) { |
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
mainClassName = 'io.vertx.core.Launcher' | |
shadowJar { | |
classifier = 'fat' | |
manifest { | |
attributes( | |
'Main-Verticle': 'com.majan.admintools.api.AdminToolsVerticle' | |
) | |
} | |
mergeServiceFiles { |
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 JdbcUtil { | |
private static JDBCClient jdbcClient; | |
public static void initialize(Vertx vertx) { | |
JsonObject config = vertx.getOrCreateContext().config(); | |
if(jdbcClient == null) { | |
final JsonObject jdbcConfig = new JsonObject() |
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 VehicleOwnerService { | |
public static Observable<Integer> insert(VehicleOwner vehicleOwner) { | |
InsertStatement insert = new InsertStatement(vehicleOwner); | |
return databaseClient() | |
.getConnectionObservable() |
OlderNewer