Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ndwinton authored and billkable committed Sep 10, 2020
0 parents commit 809b3a3
Show file tree
Hide file tree
Showing 126 changed files with 5,280 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.gradle
build
.idea
*.iml
*.ipr
*.iws
.DS_Store
.env
ci/variables.yml
5 changes: 5 additions & 0 deletions applications/allocations-server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apply from: "$projectDir/../server.gradle"

dependencies {
compile project(":components:allocations")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.pivotal.pal.tracker.allocations;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestOperations;

import java.util.TimeZone;


@SpringBootApplication
@ComponentScan({"io.pivotal.pal.tracker.allocations", "io.pivotal.pal.tracker.restsupport"})
public class App {

public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
SpringApplication.run(App.class, args);
}

@Bean
ProjectClient projectClient(
RestOperations restOperations,
@Value("${registration.server.endpoint}") String registrationEndpoint
) {
return new ProjectClient(restOperations, registrationEndpoint);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring.application.name=allocations-server

server.port=8081
spring.datasource.username=tracker
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_allocations_dev?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
registration.server.endpoint=http://localhost:8083
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package test.pivotal.pal.tracker.allocations;

import io.pivotal.pal.tracker.allocations.App;
import org.junit.Test;
import org.springframework.web.client.RestTemplate;

import static org.assertj.core.api.Assertions.assertThat;

public class AllocationsAppTest {

@Test
public void embedded() {
App.main(new String[]{});

String response = new RestTemplate().getForObject("http://localhost:8181/allocations?projectId=0", String.class);

assertThat(response).isEqualTo("[]");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring.application.name=allocations-server

server.port=8181
spring.datasource.username=tracker
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_allocations_test?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
registration.server.endpoint=http://localhost:8883
5 changes: 5 additions & 0 deletions applications/backlog-server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apply from: "$projectDir/../server.gradle"

dependencies {
compile project(":components:backlog")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.pivotal.pal.tracker.backlog;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestOperations;

import java.util.TimeZone;


@SpringBootApplication
@ComponentScan({"io.pivotal.pal.tracker.backlog", "io.pivotal.pal.tracker.restsupport"})
public class App {

public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
SpringApplication.run(App.class, args);
}

@Bean
ProjectClient projectClient(
RestOperations restOperations,
@Value("${registration.server.endpoint}") String registrationEndpoint
) {
return new ProjectClient(restOperations, registrationEndpoint);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring.application.name=backlog-server

server.port=8082
spring.datasource.username=tracker
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_backlog_dev?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
registration.server.endpoint=http://localhost:8083
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package test.pivotal.pal.tracker.backlog;

import io.pivotal.pal.tracker.backlog.App;
import org.junit.Test;
import org.springframework.web.client.RestTemplate;

import static org.assertj.core.api.Assertions.assertThat;

public class BacklogAppTest {

@Test
public void embedded() {
App.main(new String[]{});

String response = new RestTemplate().getForObject("http://localhost:8181/stories?projectId=0", String.class);

assertThat(response).isEqualTo("[]");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring.application.name=backlog-server

server.port=8181
spring.datasource.username=tracker
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_backlog_test?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
registration.server.endpoint=http://localhost:8883
7 changes: 7 additions & 0 deletions applications/registration-server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apply from: "$projectDir/../server.gradle"

dependencies {
compile project(":components:accounts")
compile project(":components:projects")
compile project(":components:users")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.pivotal.pal.tracker.registration;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

import java.util.TimeZone;


@SpringBootApplication
@ComponentScan({
"io.pivotal.pal.tracker.accounts",
"io.pivotal.pal.tracker.restsupport",
"io.pivotal.pal.tracker.projects",
"io.pivotal.pal.tracker.users",
"io.pivotal.pal.tracker.registration"
})
public class App {
public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
SpringApplication.run(App.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring.application.name=registration-server

server.port=8083
spring.datasource.username=tracker
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_registration_dev?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
registration.server.endpoint=http://localhost:8083
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package test.pivotal.pal.tracker.registration;

import io.pivotal.pal.tracker.registration.App;
import org.junit.Test;
import org.springframework.web.client.RestTemplate;

import static org.assertj.core.api.Assertions.assertThat;

public class RegistrationAppTest {

@Test
public void embedded() {
App.main(new String[]{});

RestTemplate restTemplate = new RestTemplate();

assertThat(restTemplate.getForObject("http://localhost:8181/accounts?ownerId=0", String.class)).isEqualTo("[]");
assertThat(restTemplate.getForObject("http://localhost:8181/projects?accountId=0", String.class)).isEqualTo("[]");
assertThat(restTemplate.getForObject("http://localhost:8181/projects/0", String.class)).isEqualTo(null);
assertThat(restTemplate.getForObject("http://localhost:8181/users/0", String.class)).isEqualTo(null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring.application.name=registration-server

server.port=8181
spring.datasource.username=tracker
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_registration_test?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
registration.server.endpoint=http://localhost:8883
14 changes: 14 additions & 0 deletions applications/server.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"

dependencies {
compile project(":components:rest-support")

compile "org.springframework.boot:spring-boot-starter-web"

compile "com.zaxxer:HikariCP:$hikariVersion"
compile "mysql:mysql-connector-java:$mysqlVersion"
compile "ch.qos.logback:logback-classic:$logbackVersion"

testCompile project(":components:test-support")
}
5 changes: 5 additions & 0 deletions applications/timesheets-server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apply from: "$projectDir/../server.gradle"

dependencies {
compile project(":components:timesheets")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.pivotal.pal.tracker.timesheets;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestOperations;

import java.util.TimeZone;


@SpringBootApplication
@ComponentScan({"io.pivotal.pal.tracker.timesheets", "io.pivotal.pal.tracker.restsupport"})
public class App {

public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
SpringApplication.run(App.class, args);
}

@Bean
ProjectClient projectClient(
RestOperations restOperations,
@Value("${registration.server.endpoint}") String registrationEndpoint
) {
return new ProjectClient(restOperations, registrationEndpoint);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring.application.name=timesheets-server

server.port=8084
spring.datasource.username=tracker
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_timesheets_dev?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
registration.server.endpoint=http://localhost:8083
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package test.pivotal.pal.tracker.timesheets;

import io.pivotal.pal.tracker.timesheets.App;
import org.junit.Test;
import org.springframework.web.client.RestTemplate;

import static org.assertj.core.api.Assertions.assertThat;

public class TimesheetsAppTest {

@Test
public void embedded() {
App.main(new String[]{});

String response = new RestTemplate().getForObject("http://localhost:8181/time-entries?userId=0", String.class);

assertThat(response).isEqualTo("[]");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring.application.name=timesheets-server

server.port=8181
spring.datasource.username=tracker
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_timesheets_test?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
registration.server.endpoint=http://localhost:8883
59 changes: 59 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import io.pivotal.pal.tracker.gradlebuild.DependenciesGraphPlugin

buildscript {
ext {
springBootVersion = "2.1.13.RELEASE"
springVersion = "5.1.14.RELEASE"
mysqlVersion = "8.0.13"
jacksonVersion = "2.9.7"
slf4jVersion = "1.7.25"
mockitoVersion = "2.23.0"
assertJVersion = "3.11.1"
hikariVersion = "3.1.0"
logbackVersion = "1.2.3"
junitVersion = "4.12"
okhttpVersion = "3.12.0"
jsonPathVersion = "2.4.0"
}

repositories {
mavenCentral()
jcenter()
}

dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath "mysql:mysql-connector-java:$mysqlVersion"
}
}

apply plugin: DependenciesGraphPlugin

subprojects {
group "io.pivotal.pal.tracker"

apply plugin: "java"
defaultTasks "clean", "build"

repositories {
mavenCentral()
jcenter()
}

dependencies {
compile "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
compile "org.slf4j:slf4j-api:$slf4jVersion"

testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "org.assertj:assertj-core:$assertJVersion"
}

test {
testLogging {
exceptionFormat = 'full'
}
}
}
7 changes: 7 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repositories {
mavenCentral()
}

dependencies {
compile "org.flywaydb:flyway-gradle-plugin:5.2.1"
}
Loading

0 comments on commit 809b3a3

Please sign in to comment.