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

Commit 809b3a3

Browse files
ndwintonbillkable
authored andcommitted
Initial commit
0 parents  commit 809b3a3

File tree

126 files changed

+5280
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+5280
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.gradle
2+
build
3+
.idea
4+
*.iml
5+
*.ipr
6+
*.iws
7+
.DS_Store
8+
.env
9+
ci/variables.yml
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apply from: "$projectDir/../server.gradle"
2+
3+
dependencies {
4+
compile project(":components:allocations")
5+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package io.pivotal.pal.tracker.allocations;
2+
3+
import org.springframework.beans.factory.annotation.Value;
4+
import org.springframework.boot.SpringApplication;
5+
import org.springframework.boot.autoconfigure.SpringBootApplication;
6+
import org.springframework.context.annotation.Bean;
7+
import org.springframework.context.annotation.ComponentScan;
8+
import org.springframework.web.client.RestOperations;
9+
10+
import java.util.TimeZone;
11+
12+
13+
@SpringBootApplication
14+
@ComponentScan({"io.pivotal.pal.tracker.allocations", "io.pivotal.pal.tracker.restsupport"})
15+
public class App {
16+
17+
public static void main(String[] args) {
18+
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
19+
SpringApplication.run(App.class, args);
20+
}
21+
22+
@Bean
23+
ProjectClient projectClient(
24+
RestOperations restOperations,
25+
@Value("${registration.server.endpoint}") String registrationEndpoint
26+
) {
27+
return new ProjectClient(restOperations, registrationEndpoint);
28+
}
29+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
spring.application.name=allocations-server
2+
3+
server.port=8081
4+
spring.datasource.username=tracker
5+
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_allocations_dev?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
6+
registration.server.endpoint=http://localhost:8083
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package test.pivotal.pal.tracker.allocations;
2+
3+
import io.pivotal.pal.tracker.allocations.App;
4+
import org.junit.Test;
5+
import org.springframework.web.client.RestTemplate;
6+
7+
import static org.assertj.core.api.Assertions.assertThat;
8+
9+
public class AllocationsAppTest {
10+
11+
@Test
12+
public void embedded() {
13+
App.main(new String[]{});
14+
15+
String response = new RestTemplate().getForObject("http://localhost:8181/allocations?projectId=0", String.class);
16+
17+
assertThat(response).isEqualTo("[]");
18+
}
19+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
spring.application.name=allocations-server
2+
3+
server.port=8181
4+
spring.datasource.username=tracker
5+
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_allocations_test?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
6+
registration.server.endpoint=http://localhost:8883
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apply from: "$projectDir/../server.gradle"
2+
3+
dependencies {
4+
compile project(":components:backlog")
5+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package io.pivotal.pal.tracker.backlog;
2+
3+
import org.springframework.beans.factory.annotation.Value;
4+
import org.springframework.boot.SpringApplication;
5+
import org.springframework.boot.autoconfigure.SpringBootApplication;
6+
import org.springframework.context.annotation.Bean;
7+
import org.springframework.context.annotation.ComponentScan;
8+
import org.springframework.web.client.RestOperations;
9+
10+
import java.util.TimeZone;
11+
12+
13+
@SpringBootApplication
14+
@ComponentScan({"io.pivotal.pal.tracker.backlog", "io.pivotal.pal.tracker.restsupport"})
15+
public class App {
16+
17+
public static void main(String[] args) {
18+
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
19+
SpringApplication.run(App.class, args);
20+
}
21+
22+
@Bean
23+
ProjectClient projectClient(
24+
RestOperations restOperations,
25+
@Value("${registration.server.endpoint}") String registrationEndpoint
26+
) {
27+
return new ProjectClient(restOperations, registrationEndpoint);
28+
}
29+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
spring.application.name=backlog-server
2+
3+
server.port=8082
4+
spring.datasource.username=tracker
5+
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_backlog_dev?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false
6+
registration.server.endpoint=http://localhost:8083
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package test.pivotal.pal.tracker.backlog;
2+
3+
import io.pivotal.pal.tracker.backlog.App;
4+
import org.junit.Test;
5+
import org.springframework.web.client.RestTemplate;
6+
7+
import static org.assertj.core.api.Assertions.assertThat;
8+
9+
public class BacklogAppTest {
10+
11+
@Test
12+
public void embedded() {
13+
App.main(new String[]{});
14+
15+
String response = new RestTemplate().getForObject("http://localhost:8181/stories?projectId=0", String.class);
16+
17+
assertThat(response).isEqualTo("[]");
18+
}
19+
}

0 commit comments

Comments
 (0)