From 59a00bb3ce3198a5251a4b5924ece6136f35ed6c Mon Sep 17 00:00:00 2001 From: sashinpivotal Date: Mon, 19 Nov 2018 18:47:55 -0500 Subject: [PATCH 01/14] Initial commit --- .gitignore | 5 +++++ pal-tracker-codebase.txt | 1 + 2 files changed, 6 insertions(+) create mode 100644 .gitignore create mode 100644 pal-tracker-codebase.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..4fa332f5c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +build +.gradle +.idea +*.iml +ci/variables.yml diff --git a/pal-tracker-codebase.txt b/pal-tracker-codebase.txt new file mode 100644 index 000000000..0943c3cd3 --- /dev/null +++ b/pal-tracker-codebase.txt @@ -0,0 +1 @@ +pal-tracker codebase From 55b019ab19c18a2de8399f6535e6cbb77e76f5e3 Mon Sep 17 00:00:00 2001 From: sashinpivotal Date: Mon, 19 Nov 2018 18:47:55 -0500 Subject: [PATCH 02/14] initial cherry pick From d7bf6ad3cb96aa44f9d3aca4e9f6671f7526746a Mon Sep 17 00:00:00 2001 From: Tito Yslas Date: Wed, 24 Jul 2019 12:21:40 -0600 Subject: [PATCH 03/14] lab01 pcf dev java class review - deploy app with hello controller --- build.gradle | 27 +++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 55616 bytes gradle/wrapper/gradle-wrapper.properties | 5 + gradlew | 188 ++++++++++++++++++ gradlew.bat | 100 ++++++++++ pal-tracker.yml | 7 + settings.gradle | 1 + .../pal/tracker/PalTrackerApplication.java | 12 ++ .../pal/tracker/WelcomeController.java | 13 ++ 9 files changed, 353 insertions(+) create mode 100644 build.gradle create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 pal-tracker.yml create mode 100644 settings.gradle create mode 100644 src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java create mode 100644 src/main/java/io/pivotal/pal/tracker/WelcomeController.java diff --git a/build.gradle b/build.gradle new file mode 100644 index 000000000..624a00c8b --- /dev/null +++ b/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'org.springframework.boot' version '2.1.6.RELEASE' + id 'java' + id 'idea' +} + +apply plugin: 'io.spring.dependency-management' + +group = 'io.pivotal.pal.tracker' +version = '0.0.1-SNAPSHOT' +sourceCompatibility = '1.8' + +repositories { + mavenCentral() +} + +dependencies { + compile('org.springframework.boot:spring-boot-starter-web') + + //the below are the dependencies contained in 'spring-boot-starter-web' +/* compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.0.pr1' + compile group: 'org.hibernate.validator', name: 'hibernate-validator', version: '6.0.17.Final' + compile group: 'org.springframework', name: 'spring-web', version: '5.1.8.RELEASE' + compile group: 'org.springframework', name: 'spring-webmvc', version: '5.1.8.RELEASE' + compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.1.6.RELEASE' + compile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '2.1.6.RELEASE'*/ +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..5c2d1cf016b3885f6930543d57b744ea8c220a1a GIT binary patch literal 55616 zcmafaW0WS*vSoFbZJS-TZP!<}ZQEV8ZQHihW!tvx>6!c9%-lQoy;&DmfdT@8fB*sl68LLCKtKQ283+jS?^Q-bNq|NIAW8=eB==8_)^)r*{C^$z z{u;{v?IMYnO`JhmPq7|LA_@Iz75S9h~8`iX>QrjrmMeu{>hn4U;+$dor zz+`T8Q0f}p^Ao)LsYq74!W*)&dTnv}E8;7H*Zetclpo2zf_f>9>HT8;`O^F8;M%l@ z57Z8dk34kG-~Wg7n48qF2xwPp;SOUpd1}9Moir5$VSyf4gF)Mp-?`wO3;2x9gYj59oFwG>?Leva43@e(z{mjm0b*@OAYLC`O9q|s+FQLOE z!+*Y;%_0(6Sr<(cxE0c=lS&-FGBFGWd_R<5$vwHRJG=tB&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y8F43lX7hYx<{v^Q9`2QsMzeen3cGpiTgzVp- z`aj3&Wv0(he1qKI!2jpGpO-i0Wpcz%vdn`2o9x&3;^nsZPt3c \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 000000000..9618d8d96 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/pal-tracker.yml b/pal-tracker.yml new file mode 100644 index 000000000..1fdb05fce --- /dev/null +++ b/pal-tracker.yml @@ -0,0 +1,7 @@ +--- +applications: + - name: pal-tracker-tito + path: ./build/libs/pal-tracker-0.0.1-SNAPSHOT.jar + buildpacks: + - java_buildpack + memory: 1G diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 000000000..05c90d22c --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "pal-tracker" diff --git a/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java b/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java new file mode 100644 index 000000000..e33c3526e --- /dev/null +++ b/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java @@ -0,0 +1,12 @@ +package io.pivotal.pal.tracker; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class PalTrackerApplication { + + public static void main(String[] args) { + SpringApplication.run(PalTrackerApplication.class, args); + } +} diff --git a/src/main/java/io/pivotal/pal/tracker/WelcomeController.java b/src/main/java/io/pivotal/pal/tracker/WelcomeController.java new file mode 100644 index 000000000..4670637ec --- /dev/null +++ b/src/main/java/io/pivotal/pal/tracker/WelcomeController.java @@ -0,0 +1,13 @@ +package io.pivotal.pal.tracker; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class WelcomeController { + + @GetMapping("/") + public String sayHello() { + return "hello"; + } +} From 413c59a5c7e35da201fc415a780e5cd925f9d0bc Mon Sep 17 00:00:00 2001 From: sashinpivotal Date: Mon, 19 Nov 2018 19:45:47 -0500 Subject: [PATCH 04/14] Add tests for deployment lab --- .../pal/tracker/EnvControllerTest.java | 28 +++++++++++++++++++ .../pal/tracker/WelcomeControllerTest.java | 16 +++++++++++ .../pal/trackerapi/WelcomeApiTest.java | 26 +++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 src/test/java/test/pivotal/pal/tracker/EnvControllerTest.java create mode 100644 src/test/java/test/pivotal/pal/tracker/WelcomeControllerTest.java create mode 100644 src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java diff --git a/src/test/java/test/pivotal/pal/tracker/EnvControllerTest.java b/src/test/java/test/pivotal/pal/tracker/EnvControllerTest.java new file mode 100644 index 000000000..fda0f0f34 --- /dev/null +++ b/src/test/java/test/pivotal/pal/tracker/EnvControllerTest.java @@ -0,0 +1,28 @@ +package test.pivotal.pal.tracker; + +import org.junit.Test; + +import java.util.Map; +import io.pivotal.pal.tracker.EnvController; + +import static org.assertj.core.api.Assertions.assertThat; + +public class EnvControllerTest { + @Test + public void getEnv() throws Exception { + EnvController controller = new EnvController( + "8675", + "12G", + "34", + "123.sesame.street" + ); + + Map env = controller.getEnv(); + + assertThat(env.get("PORT")).isEqualTo("8675"); + assertThat(env.get("MEMORY_LIMIT")).isEqualTo("12G"); + assertThat(env.get("CF_INSTANCE_INDEX")).isEqualTo("34"); + assertThat(env.get("CF_INSTANCE_ADDR")).isEqualTo("123.sesame.street"); + } + +} diff --git a/src/test/java/test/pivotal/pal/tracker/WelcomeControllerTest.java b/src/test/java/test/pivotal/pal/tracker/WelcomeControllerTest.java new file mode 100644 index 000000000..bfa8271a0 --- /dev/null +++ b/src/test/java/test/pivotal/pal/tracker/WelcomeControllerTest.java @@ -0,0 +1,16 @@ +package test.pivotal.pal.tracker; + +import io.pivotal.pal.tracker.WelcomeController; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class WelcomeControllerTest { + + @Test + public void itSaysHello() throws Exception { + WelcomeController controller = new WelcomeController("A welcome message"); + + assertThat(controller.sayHello()).isEqualTo("A welcome message"); + } +} diff --git a/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java new file mode 100644 index 000000000..cc7091ed4 --- /dev/null +++ b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java @@ -0,0 +1,26 @@ +package test.pivotal.pal.trackerapi; + +import io.pivotal.pal.tracker.PalTrackerApplication; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = PalTrackerApplication.class, webEnvironment = RANDOM_PORT) +public class WelcomeApiTest { + + @Autowired + private TestRestTemplate restTemplate; + + @Test + public void exampleTest() { + String body = this.restTemplate.getForObject("/", String.class); + assertThat(body).isEqualTo("Hello from test"); + } +} From 960b54b0f1ca4e83128937f68c94f02d82d436a5 Mon Sep 17 00:00:00 2001 From: Tito Yslas Date: Wed, 24 Jul 2019 15:35:06 -0600 Subject: [PATCH 05/14] deployed to pcf with ymls/env; all tests passing; manifest updated --- build.gradle | 14 ++++++- out/production/resources/application-test.yml | 2 + out/production/resources/application.yml | 2 + pal-tracker.yml | 2 +- .../io/pivotal/pal/tracker/EnvController.java | 37 +++++++++++++++++++ .../pal/tracker/WelcomeController.java | 10 ++++- src/main/resources/application-cloud.yml | 5 +++ src/main/resources/application-test.yml | 2 + src/main/resources/application.yml | 5 +++ .../pal/trackerapi/WelcomeApiTest.java | 2 + 10 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 out/production/resources/application-test.yml create mode 100644 out/production/resources/application.yml create mode 100644 src/main/java/io/pivotal/pal/tracker/EnvController.java create mode 100644 src/main/resources/application-cloud.yml create mode 100644 src/main/resources/application-test.yml create mode 100644 src/main/resources/application.yml diff --git a/build.gradle b/build.gradle index 624a00c8b..602c07e47 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,6 @@ repositories { dependencies { compile('org.springframework.boot:spring-boot-starter-web') - //the below are the dependencies contained in 'spring-boot-starter-web' /* compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.0.pr1' compile group: 'org.hibernate.validator', name: 'hibernate-validator', version: '6.0.17.Final' @@ -24,4 +23,15 @@ dependencies { compile group: 'org.springframework', name: 'spring-webmvc', version: '5.1.8.RELEASE' compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.1.6.RELEASE' compile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '2.1.6.RELEASE'*/ -} \ No newline at end of file + + testCompile('org.springframework.boot:spring-boot-starter-test') +} + +//can use instead of yaml +//bootRun.environment([ +// "WELCOME_MESSAGE": "hello", +//]) +// +//test.environment([ +// "WELCOME_MESSAGE": "Hello from test", +//]) \ No newline at end of file diff --git a/out/production/resources/application-test.yml b/out/production/resources/application-test.yml new file mode 100644 index 000000000..fbd0221ae --- /dev/null +++ b/out/production/resources/application-test.yml @@ -0,0 +1,2 @@ +--- +welcome_message: "Hello from test" \ No newline at end of file diff --git a/out/production/resources/application.yml b/out/production/resources/application.yml new file mode 100644 index 000000000..ab3b69c7d --- /dev/null +++ b/out/production/resources/application.yml @@ -0,0 +1,2 @@ +--- +welcome_message: "hello from yaml!" \ No newline at end of file diff --git a/pal-tracker.yml b/pal-tracker.yml index 1fdb05fce..c8cd57d12 100644 --- a/pal-tracker.yml +++ b/pal-tracker.yml @@ -4,4 +4,4 @@ applications: path: ./build/libs/pal-tracker-0.0.1-SNAPSHOT.jar buildpacks: - java_buildpack - memory: 1G + memory: 1G \ No newline at end of file diff --git a/src/main/java/io/pivotal/pal/tracker/EnvController.java b/src/main/java/io/pivotal/pal/tracker/EnvController.java new file mode 100644 index 000000000..7e9c51da0 --- /dev/null +++ b/src/main/java/io/pivotal/pal/tracker/EnvController.java @@ -0,0 +1,37 @@ +package io.pivotal.pal.tracker; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +public class EnvController { + + private String PORT; + private String MEMORY_LIMIT; + private String CF_INSTANCE_INDEX; + private String CF_INSTANCE_ADDR; + + public EnvController(@Value("${PORT:8675}") String port, + @Value("${MEMORY_LIMIT:12G}") String memory_limit, + @Value("${CF_INSTANCE_INDEX:34}") String cf_instance_index, + @Value("${CF_INSTANCE_ADDR:123.sesame.street}") String cf_instance_address) { + this.PORT = port; + this.MEMORY_LIMIT = memory_limit; + this.CF_INSTANCE_INDEX = cf_instance_index; + this.CF_INSTANCE_ADDR = cf_instance_address; + } + + @GetMapping("/env") + public Map getEnv() { + Map env = new HashMap<>(); + env.put("PORT", PORT); + env.put("MEMORY_LIMIT", MEMORY_LIMIT); + env.put("CF_INSTANCE_INDEX", CF_INSTANCE_INDEX); + env.put("CF_INSTANCE_ADDR", CF_INSTANCE_ADDR); + return env; + } +} diff --git a/src/main/java/io/pivotal/pal/tracker/WelcomeController.java b/src/main/java/io/pivotal/pal/tracker/WelcomeController.java index 4670637ec..0ab20e36e 100644 --- a/src/main/java/io/pivotal/pal/tracker/WelcomeController.java +++ b/src/main/java/io/pivotal/pal/tracker/WelcomeController.java @@ -1,13 +1,21 @@ package io.pivotal.pal.tracker; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class WelcomeController { + + private String WELCOME_MESSAGE; + + public WelcomeController(@Value("${welcome_message}") String welcome_message) { + this.WELCOME_MESSAGE = welcome_message; + } + @GetMapping("/") public String sayHello() { - return "hello"; + return WELCOME_MESSAGE; } } diff --git a/src/main/resources/application-cloud.yml b/src/main/resources/application-cloud.yml new file mode 100644 index 000000000..6222c68cf --- /dev/null +++ b/src/main/resources/application-cloud.yml @@ -0,0 +1,5 @@ +--- +spring: + application: + name: pal-tracker +welcome_message: "hello from cloud foundry/yaml!" \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 000000000..fbd0221ae --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,2 @@ +--- +welcome_message: "Hello from test" \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 000000000..b980d66b4 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,5 @@ +--- +spring: + application: + name: pal-tracker +welcome_message: "hello from yaml!" \ No newline at end of file diff --git a/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java index cc7091ed4..c949819a9 100644 --- a/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java +++ b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java @@ -1,6 +1,7 @@ package test.pivotal.pal.trackerapi; import io.pivotal.pal.tracker.PalTrackerApplication; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -13,6 +14,7 @@ @RunWith(SpringRunner.class) @SpringBootTest(classes = PalTrackerApplication.class, webEnvironment = RANDOM_PORT) +@Ignore("test can only be run when SPRING_PROFILES_ACTIVE=test") public class WelcomeApiTest { @Autowired From a7dc8449bdea9e8dce3888bf9ac2c31129c2334e Mon Sep 17 00:00:00 2001 From: sashinpivotal Date: Mon, 19 Nov 2018 20:16:01 -0500 Subject: [PATCH 06/14] Add deployment pipeline --- .travis.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..bd2110494 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,39 @@ +dist: trusty +sudo: false +notifications: + email: false +env: + - RELEASE_TAG="release-$TRAVIS_BUILD_NUMBER" +if: tag IS blank + + +jobs: + include: + - stage: build and publish + language: java + jdk: openjdk11 + install: skip + script: ./gradlew clean build + before_deploy: + - git config --local user.name "Travis CI" + - git config --local user.email "travis@example.com" + - git tag -f $RELEASE_TAG + deploy: + provider: releases + api_key: $GITHUB_OAUTH_TOKEN + file: "build/libs/pal-tracker.jar" + skip_cleanup: true + - stage: deploy to cf + language: bash + script: + - echo "Downloading $RELEASE_TAG" + - wget -P build/libs https://github.com/$GITHUB_USERNAME/pal-tracker/releases/download/$RELEASE_TAG/pal-tracker.jar + before_deploy: + - echo "Deploying $RELEASE_TAG to Cloud Foundry" + deploy: + provider: cloudfoundry + api: $CF_API_URL + username: $CF_USERNAME + password: $CF_PASSWORD + organization: $CF_ORG + space: $CF_SPACE From 122ed4328bca92a57a34499e95e06912f727e243 Mon Sep 17 00:00:00 2001 From: sashinpivotal Date: Tue, 20 Nov 2018 15:25:25 -0500 Subject: [PATCH 07/14] Add tests for MVC lab --- .../InMemoryTimeEntryRepositoryTest.java | 120 ++++++++++++++++ .../pal/tracker/TimeEntryControllerTest.java | 129 +++++++++++++++++ .../pal/trackerapi/TimeEntryApiTest.java | 130 ++++++++++++++++++ 3 files changed, 379 insertions(+) create mode 100644 src/test/java/test/pivotal/pal/tracker/InMemoryTimeEntryRepositoryTest.java create mode 100644 src/test/java/test/pivotal/pal/tracker/TimeEntryControllerTest.java create mode 100644 src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java diff --git a/src/test/java/test/pivotal/pal/tracker/InMemoryTimeEntryRepositoryTest.java b/src/test/java/test/pivotal/pal/tracker/InMemoryTimeEntryRepositoryTest.java new file mode 100644 index 000000000..bfd6d6e6e --- /dev/null +++ b/src/test/java/test/pivotal/pal/tracker/InMemoryTimeEntryRepositoryTest.java @@ -0,0 +1,120 @@ +package test.pivotal.pal.tracker; + +import io.pivotal.pal.tracker.InMemoryTimeEntryRepository; +import io.pivotal.pal.tracker.TimeEntry; +import org.junit.Test; + +import java.time.LocalDate; +import java.util.List; + +import static java.util.Arrays.asList; +import static org.assertj.core.api.Assertions.assertThat; + +public class InMemoryTimeEntryRepositoryTest { + @Test + public void create() throws Exception { + InMemoryTimeEntryRepository repo = new InMemoryTimeEntryRepository(); + + long projectId = 123L; + long userId = 456L; + TimeEntry createdTimeEntry = repo.create(new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8)); + + long timeEntryId = 1L; + TimeEntry expected = new TimeEntry(timeEntryId, projectId, userId, LocalDate.parse("2017-01-08"), 8); + assertThat(createdTimeEntry).isEqualTo(expected); + + TimeEntry readEntry = repo.find(createdTimeEntry.getId()); + assertThat(readEntry).isEqualTo(expected); + } + + @Test + public void find() throws Exception { + InMemoryTimeEntryRepository repo = new InMemoryTimeEntryRepository(); + + long projectId = 123L; + long userId = 456L; + repo.create(new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8)); + + long timeEntryId = 1L; + TimeEntry expected = new TimeEntry(timeEntryId, projectId, userId, LocalDate.parse("2017-01-08"), 8); + TimeEntry readEntry = repo.find(timeEntryId); + assertThat(readEntry).isEqualTo(expected); + } + + @Test + public void find_MissingEntry() { + InMemoryTimeEntryRepository repo = new InMemoryTimeEntryRepository(); + + long timeEntryId = 1L; + + TimeEntry readEntry = repo.find(timeEntryId); + assertThat(readEntry).isNull(); + } + + @Test + public void list() throws Exception { + InMemoryTimeEntryRepository repo = new InMemoryTimeEntryRepository(); + repo.create(new TimeEntry(123L, 456L, LocalDate.parse("2017-01-08"), 8)); + repo.create(new TimeEntry(789L, 654L, LocalDate.parse("2017-01-07"), 4)); + + List expected = asList( + new TimeEntry(1L, 123L, 456L, LocalDate.parse("2017-01-08"), 8), + new TimeEntry(2L, 789L, 654L, LocalDate.parse("2017-01-07"), 4) + ); + assertThat(repo.list()).isEqualTo(expected); + } + + @Test + public void update() throws Exception { + InMemoryTimeEntryRepository repo = new InMemoryTimeEntryRepository(); + TimeEntry created = repo.create(new TimeEntry(123L, 456L, LocalDate.parse("2017-01-08"), 8)); + + TimeEntry updatedEntry = repo.update( + created.getId(), + new TimeEntry(321L, 654L, LocalDate.parse("2017-01-09"), 5)); + + TimeEntry expected = new TimeEntry(created.getId(), 321L, 654L, LocalDate.parse("2017-01-09"), 5); + assertThat(updatedEntry).isEqualTo(expected); + assertThat(repo.find(created.getId())).isEqualTo(expected); + } + + @Test + public void update_MissingEntry() { + InMemoryTimeEntryRepository repo = new InMemoryTimeEntryRepository(); + + TimeEntry updatedEntry = repo.update( + 1L, + new TimeEntry(321L, 654L, LocalDate.parse("2017-01-09"), 5)); + + assertThat(updatedEntry).isNull(); + } + + @Test + public void delete() throws Exception { + InMemoryTimeEntryRepository repo = new InMemoryTimeEntryRepository(); + + long projectId = 123L; + long userId = 456L; + TimeEntry created = repo.create(new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8)); + + repo.delete(created.getId()); + assertThat(repo.list()).isEmpty(); + } + + @Test + public void deleteKeepsTrackOfLatestIdProperly() { + InMemoryTimeEntryRepository repo = new InMemoryTimeEntryRepository(); + + long projectId = 123L; + long userId = 456L; + TimeEntry created = repo.create(new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8)); + + assertThat(created.getId()).isEqualTo(1); + + repo.delete(created.getId()); + + TimeEntry createdSecond = repo.create(new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8)); + + assertThat(createdSecond.getId()).isEqualTo(2); + } +} diff --git a/src/test/java/test/pivotal/pal/tracker/TimeEntryControllerTest.java b/src/test/java/test/pivotal/pal/tracker/TimeEntryControllerTest.java new file mode 100644 index 000000000..7af2f223b --- /dev/null +++ b/src/test/java/test/pivotal/pal/tracker/TimeEntryControllerTest.java @@ -0,0 +1,129 @@ +package test.pivotal.pal.tracker; + +import io.pivotal.pal.tracker.TimeEntry; +import io.pivotal.pal.tracker.TimeEntryController; +import io.pivotal.pal.tracker.TimeEntryRepository; +import org.junit.Before; +import org.junit.Test; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +import java.time.LocalDate; +import java.util.List; + +import static java.util.Arrays.asList; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.*; + +public class TimeEntryControllerTest { + private TimeEntryRepository timeEntryRepository; + private TimeEntryController controller; + + @Before + public void setUp() throws Exception { + timeEntryRepository = mock(TimeEntryRepository.class); + controller = new TimeEntryController(timeEntryRepository); + } + + @Test + public void testCreate() throws Exception { + long projectId = 123L; + long userId = 456L; + TimeEntry timeEntryToCreate = new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8); + + long timeEntryId = 1L; + TimeEntry expectedResult = new TimeEntry(timeEntryId, projectId, userId, LocalDate.parse("2017-01-08"), 8); + doReturn(expectedResult) + .when(timeEntryRepository) + .create(any(TimeEntry.class)); + + + ResponseEntity response = controller.create(timeEntryToCreate); + + + verify(timeEntryRepository).create(timeEntryToCreate); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.CREATED); + assertThat(response.getBody()).isEqualTo(expectedResult); + } + + @Test + public void testRead() throws Exception { + long timeEntryId = 1L; + long projectId = 123L; + long userId = 456L; + TimeEntry expected = new TimeEntry(timeEntryId, projectId, userId, LocalDate.parse("2017-01-08"), 8); + doReturn(expected) + .when(timeEntryRepository) + .find(timeEntryId); + + ResponseEntity response = controller.read(timeEntryId); + + verify(timeEntryRepository).find(timeEntryId); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); + assertThat(response.getBody()).isEqualTo(expected); + } + + @Test + public void testRead_NotFound() throws Exception { + long nonExistentTimeEntryId = 1L; + doReturn(null) + .when(timeEntryRepository) + .find(nonExistentTimeEntryId); + + ResponseEntity response = controller.read(nonExistentTimeEntryId); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); + } + + @Test + public void testList() throws Exception { + List expected = asList( + new TimeEntry(1L, 123L, 456L, LocalDate.parse("2017-01-08"), 8), + new TimeEntry(2L, 789L, 321L, LocalDate.parse("2017-01-07"), 4) + ); + doReturn(expected).when(timeEntryRepository).list(); + + ResponseEntity> response = controller.list(); + + verify(timeEntryRepository).list(); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); + assertThat(response.getBody()).isEqualTo(expected); + } + + @Test + public void testUpdate() throws Exception { + long timeEntryId = 1L; + long projectId = 987L; + long userId = 654L; + TimeEntry expected = new TimeEntry(timeEntryId, projectId, userId, LocalDate.parse("2017-01-07"), 4); + doReturn(expected) + .when(timeEntryRepository) + .update(eq(timeEntryId), any(TimeEntry.class)); + + ResponseEntity response = controller.update(timeEntryId, expected); + + verify(timeEntryRepository).update(timeEntryId, expected); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); + assertThat(response.getBody()).isEqualTo(expected); + } + + @Test + public void testUpdate_NotFound() throws Exception { + long nonExistentTimeEntryId = 1L; + doReturn(null) + .when(timeEntryRepository) + .update(eq(nonExistentTimeEntryId), any(TimeEntry.class)); + + ResponseEntity response = controller.update(nonExistentTimeEntryId, new TimeEntry()); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); + } + + @Test + public void testDelete() throws Exception { + long timeEntryId = 1L; + ResponseEntity response = controller.delete(timeEntryId); + verify(timeEntryRepository).delete(timeEntryId); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NO_CONTENT); + } +} diff --git a/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java new file mode 100644 index 000000000..69c2c0b65 --- /dev/null +++ b/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java @@ -0,0 +1,130 @@ +package test.pivotal.pal.trackerapi; + +import com.jayway.jsonpath.DocumentContext; +import io.pivotal.pal.tracker.PalTrackerApplication; +import io.pivotal.pal.tracker.TimeEntry; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.junit4.SpringRunner; + +import java.time.LocalDate; +import java.util.Collection; + +import static com.jayway.jsonpath.JsonPath.parse; +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = PalTrackerApplication.class, webEnvironment = RANDOM_PORT) +public class TimeEntryApiTest { + + @Autowired + private TestRestTemplate restTemplate; + + private final long projectId = 123L; + private final long userId = 456L; + private TimeEntry timeEntry = new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8); + + @Test + public void testCreate() throws Exception { + ResponseEntity createResponse = restTemplate.postForEntity("/time-entries", timeEntry, String.class); + + + assertThat(createResponse.getStatusCode()).isEqualTo(HttpStatus.CREATED); + + DocumentContext createJson = parse(createResponse.getBody()); + assertThat(createJson.read("$.id", Long.class)).isGreaterThan(0); + assertThat(createJson.read("$.projectId", Long.class)).isEqualTo(projectId); + assertThat(createJson.read("$.userId", Long.class)).isEqualTo(userId); + assertThat(createJson.read("$.date", String.class)).isEqualTo("2017-01-08"); + assertThat(createJson.read("$.hours", Long.class)).isEqualTo(8); + } + + @Test + public void testList() throws Exception { + Long id = createTimeEntry(); + + + ResponseEntity listResponse = restTemplate.getForEntity("/time-entries", String.class); + + + assertThat(listResponse.getStatusCode()).isEqualTo(HttpStatus.OK); + + DocumentContext listJson = parse(listResponse.getBody()); + + Collection timeEntries = listJson.read("$[*]", Collection.class); + assertThat(timeEntries.size()).isEqualTo(1); + + Long readId = listJson.read("$[0].id", Long.class); + assertThat(readId).isEqualTo(id); + } + + @Test + public void testRead() throws Exception { + Long id = createTimeEntry(); + + + ResponseEntity readResponse = this.restTemplate.getForEntity("/time-entries/" + id, String.class); + + + assertThat(readResponse.getStatusCode()).isEqualTo(HttpStatus.OK); + DocumentContext readJson = parse(readResponse.getBody()); + assertThat(readJson.read("$.id", Long.class)).isEqualTo(id); + assertThat(readJson.read("$.projectId", Long.class)).isEqualTo(projectId); + assertThat(readJson.read("$.userId", Long.class)).isEqualTo(userId); + assertThat(readJson.read("$.date", String.class)).isEqualTo("2017-01-08"); + assertThat(readJson.read("$.hours", Long.class)).isEqualTo(8); + } + + @Test + public void testUpdate() throws Exception { + Long id = createTimeEntry(); + long projectId = 2L; + long userId = 3L; + TimeEntry updatedTimeEntry = new TimeEntry(projectId, userId, LocalDate.parse("2017-01-09"), 9); + + + ResponseEntity updateResponse = restTemplate.exchange("/time-entries/" + id, HttpMethod.PUT, new HttpEntity<>(updatedTimeEntry, null), String.class); + + + assertThat(updateResponse.getStatusCode()).isEqualTo(HttpStatus.OK); + + DocumentContext updateJson = parse(updateResponse.getBody()); + assertThat(updateJson.read("$.id", Long.class)).isEqualTo(id); + assertThat(updateJson.read("$.projectId", Long.class)).isEqualTo(projectId); + assertThat(updateJson.read("$.userId", Long.class)).isEqualTo(userId); + assertThat(updateJson.read("$.date", String.class)).isEqualTo("2017-01-09"); + assertThat(updateJson.read("$.hours", Long.class)).isEqualTo(9); + } + + @Test + public void testDelete() throws Exception { + Long id = createTimeEntry(); + + + ResponseEntity deleteResponse = restTemplate.exchange("/time-entries/" + id, HttpMethod.DELETE, null, String.class); + + + assertThat(deleteResponse.getStatusCode()).isEqualTo(HttpStatus.NO_CONTENT); + + ResponseEntity deletedReadResponse = this.restTemplate.getForEntity("/time-entries/" + id, String.class); + assertThat(deletedReadResponse.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); + } + + private Long createTimeEntry() { + HttpEntity entity = new HttpEntity<>(timeEntry); + + ResponseEntity response = restTemplate.exchange("/time-entries", HttpMethod.POST, entity, TimeEntry.class); + + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.CREATED); + + return response.getBody().getId(); + } +} From 21e91fd709dd944a0b9f8ab5f7295660ff3c2f1a Mon Sep 17 00:00:00 2001 From: Tito Yslas Date: Thu, 25 Jul 2019 09:52:06 -0600 Subject: [PATCH 08/14] added components for time entry functionality; all tests passing --- build.gradle | 3 + out/production/resources/application-test.yml | 2 - out/production/resources/application.yml | 2 - .../tracker/InMemoryTimeEntryRepository.java | 62 ++++++++++++++ .../pal/tracker/PalTrackerApplication.java | 20 +++++ .../io/pivotal/pal/tracker/TimeEntry.java | 84 +++++++++++++++++++ .../pal/tracker/TimeEntryController.java | 52 ++++++++++++ .../pal/tracker/TimeEntryRepository.java | 11 +++ .../pal/trackerapi/WelcomeApiTest.java | 3 +- 9 files changed, 234 insertions(+), 5 deletions(-) delete mode 100644 out/production/resources/application-test.yml delete mode 100644 out/production/resources/application.yml create mode 100644 src/main/java/io/pivotal/pal/tracker/InMemoryTimeEntryRepository.java create mode 100644 src/main/java/io/pivotal/pal/tracker/TimeEntry.java create mode 100644 src/main/java/io/pivotal/pal/tracker/TimeEntryController.java create mode 100644 src/main/java/io/pivotal/pal/tracker/TimeEntryRepository.java diff --git a/build.gradle b/build.gradle index 602c07e47..0e9e340d6 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,7 @@ repositories { } dependencies { + compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.1") compile('org.springframework.boot:spring-boot-starter-web') //the below are the dependencies contained in 'spring-boot-starter-web' /* compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.0.pr1' @@ -25,6 +26,8 @@ dependencies { compile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '2.1.6.RELEASE'*/ testCompile('org.springframework.boot:spring-boot-starter-test') + testCompile("org.mockito:mockito-core:2.23.4") + } //can use instead of yaml diff --git a/out/production/resources/application-test.yml b/out/production/resources/application-test.yml deleted file mode 100644 index fbd0221ae..000000000 --- a/out/production/resources/application-test.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -welcome_message: "Hello from test" \ No newline at end of file diff --git a/out/production/resources/application.yml b/out/production/resources/application.yml deleted file mode 100644 index ab3b69c7d..000000000 --- a/out/production/resources/application.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -welcome_message: "hello from yaml!" \ No newline at end of file diff --git a/src/main/java/io/pivotal/pal/tracker/InMemoryTimeEntryRepository.java b/src/main/java/io/pivotal/pal/tracker/InMemoryTimeEntryRepository.java new file mode 100644 index 000000000..9b920b859 --- /dev/null +++ b/src/main/java/io/pivotal/pal/tracker/InMemoryTimeEntryRepository.java @@ -0,0 +1,62 @@ +package io.pivotal.pal.tracker; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +public class InMemoryTimeEntryRepository implements TimeEntryRepository { + + private HashMap timeEntryRepo = new HashMap<>(); + private Long currentId = 1L; + + @Override + public TimeEntry create(TimeEntry timeEntry) { + Long id = currentId++; + TimeEntry newTimeEntry = new TimeEntry( + id, + timeEntry.getProjectId(), + timeEntry.getUserId(), + timeEntry.getDate(), + timeEntry.getHours() + ); + timeEntryRepo.put(id, newTimeEntry); + return newTimeEntry; + } + + @Override + public TimeEntry find(Long id) { + TimeEntry timeEntry = timeEntryRepo.get(id); + if (timeEntry != null) return timeEntry; + else return null; + } + + @Override + public List list() { + List timeEntries = new ArrayList<>(timeEntryRepo.values()); + if (timeEntries != null) return timeEntries; + else return null; + } + + @Override + public TimeEntry update(Long id, TimeEntry timeEntry) { + TimeEntry findTimeEntry = find(id); + if (findTimeEntry != null) { + TimeEntry updatedTimeEntry = new TimeEntry( + id, + timeEntry.getProjectId(), + timeEntry.getUserId(), + timeEntry.getDate(), + timeEntry.getHours() + ); + timeEntryRepo.replace(id, updatedTimeEntry); + return updatedTimeEntry; + } else return null; + } + + @Override + public void delete(Long id) { + timeEntryRepo.remove(id); +// TimeEntry timeEntry = timeEntryRepo.get(id); +// if (timeEntry != null) timeEntryRepo.remove(id); + } +} diff --git a/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java b/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java index e33c3526e..6ac82026b 100644 --- a/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java +++ b/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java @@ -1,11 +1,31 @@ package io.pivotal.pal.tracker; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; @SpringBootApplication public class PalTrackerApplication { + @Bean + TimeEntryRepository timeEntryRepository() { + return new InMemoryTimeEntryRepository(); + } + + @Bean + public ObjectMapper jsonObjectMapper() { + return Jackson2ObjectMapperBuilder.json() + .serializationInclusion(JsonInclude.Include.NON_NULL) // Don’t include null values + .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) //ISODate + .modules(new JavaTimeModule()) + .build(); + } + public static void main(String[] args) { SpringApplication.run(PalTrackerApplication.class, args); } diff --git a/src/main/java/io/pivotal/pal/tracker/TimeEntry.java b/src/main/java/io/pivotal/pal/tracker/TimeEntry.java new file mode 100644 index 000000000..a8230f269 --- /dev/null +++ b/src/main/java/io/pivotal/pal/tracker/TimeEntry.java @@ -0,0 +1,84 @@ +package io.pivotal.pal.tracker; + +import java.time.LocalDate; + +public class TimeEntry { + private long id; + private long projectId; + private long userId; + private LocalDate date; + private int hours; + + public TimeEntry() { + } + + public TimeEntry(long projectId, long userId, LocalDate date, int hours) { + this.projectId = projectId; + this.userId = userId; + this.hours = hours; + this.date = date; + } + + public TimeEntry(long id, long projectId, long userId, LocalDate date, int hours) { + this.id = id; + this.projectId = projectId; + this.userId = userId; + this.hours = hours; + this.date = date; + } + + public long getId() { + return id; + } + + public long getProjectId() { + return projectId; + } + + public long getUserId() { + return userId; + } + + public LocalDate getDate() { + return date; + } + + public int getHours() { + return hours; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + TimeEntry timeEntry = (TimeEntry) o; + + if (id != timeEntry.id) return false; + if (projectId != timeEntry.projectId) return false; + if (userId != timeEntry.userId) return false; + if (hours != timeEntry.hours) return false; + return date != null ? date.equals(timeEntry.date) : timeEntry.date == null; + } + + @Override + public int hashCode() { + int result = (int) (projectId ^ (projectId >>> 32)); + result = 31 * result + (int) (projectId ^ (projectId >>> 32)); + result = 31 * result + (int) (userId ^ (userId >>> 32)); + result = 31 * result + (date != null ? date.hashCode() : 0); + result = 31 * result + hours; + return result; + } + + @Override + public String toString() { + return "TimeEntry{" + + "id=" + id + + ", projectId=" + projectId + + ", userId=" + userId + + ", date='" + date + '\'' + + ", hours=" + hours + + '}'; + } +} diff --git a/src/main/java/io/pivotal/pal/tracker/TimeEntryController.java b/src/main/java/io/pivotal/pal/tracker/TimeEntryController.java new file mode 100644 index 000000000..25c43a65a --- /dev/null +++ b/src/main/java/io/pivotal/pal/tracker/TimeEntryController.java @@ -0,0 +1,52 @@ +package io.pivotal.pal.tracker; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/time-entries") +public class TimeEntryController { + + private TimeEntryRepository timeEntriesRepo; + + public TimeEntryController(TimeEntryRepository timeEntriesRepo) { + this.timeEntriesRepo = timeEntriesRepo; + } + + @PostMapping + public ResponseEntity create(@RequestBody TimeEntry timeEntry) { + TimeEntry createdTimeEntry = timeEntriesRepo.create(timeEntry); + + return new ResponseEntity<>(createdTimeEntry, HttpStatus.CREATED); + } + + @GetMapping("{id}") + public ResponseEntity read(@PathVariable Long id) { + TimeEntry timeEntry = timeEntriesRepo.find(id); + if (timeEntry != null) return new ResponseEntity<>(timeEntry, HttpStatus.OK); + else return new ResponseEntity<>(HttpStatus.NOT_FOUND); + } + + @GetMapping + public ResponseEntity> list() { + return new ResponseEntity<>(timeEntriesRepo.list(), HttpStatus.OK); + } + + @PutMapping("{id}") + public ResponseEntity update(@PathVariable Long id, @RequestBody TimeEntry expected) { + TimeEntry updatedTimeEntry = timeEntriesRepo.update(id, expected); + if (updatedTimeEntry != null) { + return new ResponseEntity<>(updatedTimeEntry, HttpStatus.OK); + } else return new ResponseEntity<>(HttpStatus.NOT_FOUND); + } + + @DeleteMapping("{id}") + public ResponseEntity delete(@PathVariable Long id) { + TimeEntry timeEntry = timeEntriesRepo.find(id); + timeEntriesRepo.delete(id); + return new ResponseEntity<>(timeEntry, HttpStatus.NO_CONTENT); + } +} diff --git a/src/main/java/io/pivotal/pal/tracker/TimeEntryRepository.java b/src/main/java/io/pivotal/pal/tracker/TimeEntryRepository.java new file mode 100644 index 000000000..f106aa201 --- /dev/null +++ b/src/main/java/io/pivotal/pal/tracker/TimeEntryRepository.java @@ -0,0 +1,11 @@ +package io.pivotal.pal.tracker; + +import java.util.List; + +public interface TimeEntryRepository { + TimeEntry create(TimeEntry timeEntry); + TimeEntry find(Long id); + List list(); + TimeEntry update(Long id, TimeEntry timeEntry); + void delete(Long id); +} diff --git a/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java index c949819a9..a87e52c78 100644 --- a/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java +++ b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java @@ -14,7 +14,8 @@ @RunWith(SpringRunner.class) @SpringBootTest(classes = PalTrackerApplication.class, webEnvironment = RANDOM_PORT) -@Ignore("test can only be run when SPRING_PROFILES_ACTIVE=test") +//@Ignore("test can only be run when setting SPRING_PROFILES_ACTIVE=test") +//set via the following commands from terminal: export SPRING_PROFILES_ACTIVE=test && ./gradlew clean build public class WelcomeApiTest { @Autowired From a36f95df537de11625f14a3e0c976935e87e58e5 Mon Sep 17 00:00:00 2001 From: sashinpivotal Date: Tue, 20 Nov 2018 15:53:31 -0500 Subject: [PATCH 09/14] Add task for migrating databases --- .travis.yml | 19 +++++++- scripts/migrate-databases.sh | 87 ++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 2 deletions(-) create mode 100755 scripts/migrate-databases.sh diff --git a/.travis.yml b/.travis.yml index bd2110494..ce3a644a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,13 +6,18 @@ env: - RELEASE_TAG="release-$TRAVIS_BUILD_NUMBER" if: tag IS blank - jobs: include: - stage: build and publish language: java jdk: openjdk11 + addons: + mariadb: '10.2' install: skip + before_script: + - mysql -uroot < databases/tracker/create_databases.sql + - curl https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/5.1.1/flyway-commandline-5.1.1-linux-x64.tar.gz | tar xvz + - flyway-*/flyway -url="jdbc:mysql://localhost:3306/tracker_test" -locations=filesystem:databases/tracker -user=tracker -password= clean migrate script: ./gradlew clean build before_deploy: - git config --local user.name "Travis CI" @@ -24,12 +29,22 @@ jobs: file: "build/libs/pal-tracker.jar" skip_cleanup: true - stage: deploy to cf - language: bash + language: java + before_install: + - wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - + - echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list + - sudo apt-get update + - sudo apt-get install cf-cli + - sudo apt-get -y install jq + - curl https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/5.1.1/flyway-commandline-5.1.1-linux-x64.tar.gz | tar xvz script: - echo "Downloading $RELEASE_TAG" - wget -P build/libs https://github.com/$GITHUB_USERNAME/pal-tracker/releases/download/$RELEASE_TAG/pal-tracker.jar before_deploy: - echo "Deploying $RELEASE_TAG to Cloud Foundry" + before_script: + - cf login -a $CF_API_URL -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE + - scripts/migrate-databases.sh pal-tracker . deploy: provider: cloudfoundry api: $CF_API_URL diff --git a/scripts/migrate-databases.sh b/scripts/migrate-databases.sh new file mode 100755 index 000000000..775832ff9 --- /dev/null +++ b/scripts/migrate-databases.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash + +set -e + +app_name="${1:-pal-tracker}" +script_dir="${2:-.}" +service_name="${3:-tracker-database}" +service_key="${4:-flyway-migration-key}" + +function main() { + + echo "Creating service key, if necessary ..." + + cf create-service-key $service_name $service_key > /dev/null + + echo "Retrieving target database parameters ..." + + credentials=$(cf service-key $service_name $service_key | sed -ne '/{/,$p') + + db_host=$(echo $credentials | jq -r '.hostname') + db_name=$(echo $credentials | jq -r '.name') + db_username=$(echo $credentials | jq -r '.username') + db_password=$(echo $credentials | jq -r '.password') + db_port=$(echo $credentials | jq -r '.port') + + test -n "$db_host" || exit 1 + + echo "Opening ssh tunnel to $db_host:$db_port ..." + + cf ssh -N -L 63306:$db_host:$db_port $app_name & + cf_ssh_pid=$! + + echo "Waiting for tunnel ..." + + wait_for_tunnel + + echo "Running migration ..." + + flyway-*/flyway -url="jdbc:mysql://127.0.0.1:63306/$db_name" \ + -locations=filesystem:"$script_dir"/databases/tracker \ + -user="$db_username" \ + -password="$db_password" \ + migrate + + echo "Migration complete" + +} + +function pre_tunnel_exit() { + echo "ERROR: No suitable credentials found for application '$app_name' and service '$service_name'" >&2 +} + +trap pre_tunnel_exit EXIT + +function close_tunnel_at_exit() { + echo "Closing tunnel" + kill -KILL $cf_ssh_pid +} + +trap close_tunnel_at_exit EXIT + + +function wait_for_tunnel() { + + set +e + + for x in {1..10}; do + $(nc -z localhost 63306) + nc_status=$? + if [[ "$nc_status" == "0" ]]; then + echo "Ssh tunnel success." + break + else + echo "Ssh tunnel not detected yet..." + sleep 3 + fi + done + + if [[ "$nc_status" != "0" ]] ; then + echo "Failed to detect ssh tunnel. Exiting." + exit 1 + fi + + set -e +} + +main From b4111d287f6b8a153b871feb65bf4b2b0d25ca90 Mon Sep 17 00:00:00 2001 From: Tito Yslas Date: Thu, 25 Jul 2019 14:55:54 -0600 Subject: [PATCH 10/14] cf create-service and using flyway migrations --- databases/tracker/create_databases.sql | 10 ++++++++++ databases/tracker/migrations/V1__initial_schema.sql | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 databases/tracker/create_databases.sql create mode 100644 databases/tracker/migrations/V1__initial_schema.sql diff --git a/databases/tracker/create_databases.sql b/databases/tracker/create_databases.sql new file mode 100644 index 000000000..a0674bdda --- /dev/null +++ b/databases/tracker/create_databases.sql @@ -0,0 +1,10 @@ +DROP DATABASE IF EXISTS tracker_dev; +DROP DATABASE IF EXISTS tracker_test; + +CREATE DATABASE tracker_dev; +CREATE DATABASE tracker_test; + +CREATE USER IF NOT EXISTS 'tracker'@'localhost' + IDENTIFIED BY ''; +GRANT ALL PRIVILEGES ON tracker_dev.* TO 'tracker' @'localhost'; +GRANT ALL PRIVILEGES ON tracker_test.* TO 'tracker' @'localhost'; diff --git a/databases/tracker/migrations/V1__initial_schema.sql b/databases/tracker/migrations/V1__initial_schema.sql new file mode 100644 index 000000000..3e605c0b5 --- /dev/null +++ b/databases/tracker/migrations/V1__initial_schema.sql @@ -0,0 +1,11 @@ +CREATE TABLE time_entries ( + id BIGINT(20) NOT NULL AUTO_INCREMENT, + project_id BIGINT(20), + user_id BIGINT(20), + date DATE, + hours INT, + + PRIMARY KEY (id) +) + ENGINE = innodb + DEFAULT CHARSET = utf8; From 6a046ecbd9f4adb1197443369e84039780eb1bb5 Mon Sep 17 00:00:00 2001 From: sashinpivotal Date: Tue, 20 Nov 2018 16:07:53 -0500 Subject: [PATCH 11/14] Add tests for JDBC lab --- .../tracker/JdbcTimeEntryRepositoryTest.java | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java diff --git a/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java b/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java new file mode 100644 index 000000000..e1eac20fc --- /dev/null +++ b/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java @@ -0,0 +1,159 @@ +package test.pivotal.pal.tracker; + + +import com.mysql.cj.jdbc.MysqlDataSource; +import io.pivotal.pal.tracker.JdbcTimeEntryRepository; +import io.pivotal.pal.tracker.TimeEntry; +import io.pivotal.pal.tracker.TimeEntryRepository; +import org.junit.Before; +import org.junit.Test; +import org.springframework.jdbc.core.JdbcTemplate; + +import java.sql.Date; +import java.time.LocalDate; +import java.util.List; +import java.util.Map; +import java.util.TimeZone; + +import static org.assertj.core.api.Assertions.assertThat; + +public class JdbcTimeEntryRepositoryTest { + private TimeEntryRepository subject; + private JdbcTemplate jdbcTemplate; + + @Before + public void setUp() throws Exception { + MysqlDataSource dataSource = new MysqlDataSource(); + dataSource.setUrl(System.getenv("SPRING_DATASOURCE_URL")); + + subject = new JdbcTimeEntryRepository(dataSource); + + jdbcTemplate = new JdbcTemplate(dataSource); + jdbcTemplate.execute("DELETE FROM time_entries"); + + TimeZone.setDefault(TimeZone.getTimeZone("UTC")); + } + + @Test + public void createInsertsATimeEntryRecord() throws Exception { + TimeEntry newTimeEntry = new TimeEntry(123, 321, LocalDate.parse("2017-01-09"), 8); + TimeEntry entry = subject.create(newTimeEntry); + + Map foundEntry = jdbcTemplate.queryForMap("Select * from time_entries where id = ?", entry.getId()); + + assertThat(foundEntry.get("id")).isEqualTo(entry.getId()); + assertThat(foundEntry.get("project_id")).isEqualTo(123L); + assertThat(foundEntry.get("user_id")).isEqualTo(321L); + assertThat(((Date)foundEntry.get("date")).toLocalDate()).isEqualTo(LocalDate.parse("2017-01-09")); + assertThat(foundEntry.get("hours")).isEqualTo(8); + } + + @Test + public void createReturnsTheCreatedTimeEntry() throws Exception { + TimeEntry newTimeEntry = new TimeEntry(123, 321, LocalDate.parse("2017-01-09"), 8); + TimeEntry entry = subject.create(newTimeEntry); + + assertThat(entry.getId()).isNotNull(); + assertThat(entry.getProjectId()).isEqualTo(123); + assertThat(entry.getUserId()).isEqualTo(321); + assertThat(entry.getDate()).isEqualTo(LocalDate.parse("2017-01-09")); + assertThat(entry.getHours()).isEqualTo(8); + } + + @Test + public void findFindsATimeEntry() throws Exception { + jdbcTemplate.execute( + "INSERT INTO time_entries (id, project_id, user_id, date, hours) " + + "VALUES (999, 123, 321, '2017-01-09', 8)" + ); + + TimeEntry timeEntry = subject.find(999L); + + assertThat(timeEntry.getId()).isEqualTo(999L); + assertThat(timeEntry.getProjectId()).isEqualTo(123L); + assertThat(timeEntry.getUserId()).isEqualTo(321L); + assertThat(timeEntry.getDate()).isEqualTo(LocalDate.parse("2017-01-09")); + assertThat(timeEntry.getHours()).isEqualTo(8); + } + + @Test + public void findReturnsNullWhenNotFound() throws Exception { + TimeEntry timeEntry = subject.find(999L); + + assertThat(timeEntry).isNull(); + } + + @Test + public void listFindsAllTimeEntries() throws Exception { + jdbcTemplate.execute( + "INSERT INTO time_entries (id, project_id, user_id, date, hours) " + + "VALUES (999, 123, 321, '2017-01-09', 8), (888, 456, 678, '2017-01-08', 9)" + ); + + List timeEntries = subject.list(); + assertThat(timeEntries.size()).isEqualTo(2); + + TimeEntry timeEntry = timeEntries.get(0); + assertThat(timeEntry.getId()).isEqualTo(888L); + assertThat(timeEntry.getProjectId()).isEqualTo(456L); + assertThat(timeEntry.getUserId()).isEqualTo(678L); + assertThat(timeEntry.getDate()).isEqualTo(LocalDate.parse("2017-01-08")); + assertThat(timeEntry.getHours()).isEqualTo(9); + + timeEntry = timeEntries.get(1); + assertThat(timeEntry.getId()).isEqualTo(999L); + assertThat(timeEntry.getProjectId()).isEqualTo(123L); + assertThat(timeEntry.getUserId()).isEqualTo(321L); + assertThat(timeEntry.getDate()).isEqualTo(LocalDate.parse("2017-01-09")); + assertThat(timeEntry.getHours()).isEqualTo(8); + } + + @Test + public void updateReturnsTheUpdatedRecord() throws Exception { + jdbcTemplate.execute( + "INSERT INTO time_entries (id, project_id, user_id, date, hours) " + + "VALUES (1000, 123, 321, '2017-01-09', 8)"); + + TimeEntry timeEntryUpdates = new TimeEntry(456, 987, LocalDate.parse("2017-01-10"), 10); + + TimeEntry updatedTimeEntry = subject.update(1000L, timeEntryUpdates); + + assertThat(updatedTimeEntry.getId()).isEqualTo(1000L); + assertThat(updatedTimeEntry.getProjectId()).isEqualTo(456L); + assertThat(updatedTimeEntry.getUserId()).isEqualTo(987L); + assertThat(updatedTimeEntry.getDate()).isEqualTo(LocalDate.parse("2017-01-10")); + assertThat(updatedTimeEntry.getHours()).isEqualTo(10); + } + + @Test + public void updateUpdatesTheRecord() throws Exception { + jdbcTemplate.execute( + "INSERT INTO time_entries (id, project_id, user_id, date, hours) " + + "VALUES (1000, 123, 321, '2017-01-09', 8)"); + + TimeEntry updatedTimeEntry = new TimeEntry(456, 322, LocalDate.parse("2017-01-10"), 10); + + TimeEntry timeEntry = subject.update(1000L, updatedTimeEntry); + + Map foundEntry = jdbcTemplate.queryForMap("Select * from time_entries where id = ?", timeEntry.getId()); + + assertThat(foundEntry.get("id")).isEqualTo(timeEntry.getId()); + assertThat(foundEntry.get("project_id")).isEqualTo(456L); + assertThat(foundEntry.get("user_id")).isEqualTo(322L); + assertThat(((Date)foundEntry.get("date")).toLocalDate()).isEqualTo(LocalDate.parse("2017-01-10")); + assertThat(foundEntry.get("hours")).isEqualTo(10); + } + + @Test + public void deleteRemovesTheRecord() throws Exception { + jdbcTemplate.execute( + "INSERT INTO time_entries (id, project_id, user_id, date, hours) " + + "VALUES (999, 123, 321, '2017-01-09', 8)" + ); + + subject.delete(999L); + + Map foundEntry = jdbcTemplate.queryForMap("Select count(*) count from time_entries where id = ?", 999); + assertThat(foundEntry.get("count")).isEqualTo(0L); + } +} From fb9df14454fb2bdf6cdfcac39c4894d34cfbd0c9 Mon Sep 17 00:00:00 2001 From: Tito Yslas Date: Thu, 25 Jul 2019 20:14:34 -0600 Subject: [PATCH 12/14] attempt at passing all tests - moving on --- build.gradle | 32 +++++-- .../resources/application-cloud.yml | 5 ++ out/production/resources/application-test.yml | 8 ++ out/production/resources/application.yml | 8 ++ .../pal/tracker/JdbcTimeEntryRepository.java | 88 +++++++++++++++++++ .../pal/tracker/PalTrackerApplication.java | 8 +- src/main/resources/application-test.yml | 8 +- src/main/resources/application.yml | 5 +- .../tracker/JdbcTimeEntryRepositoryTest.java | 5 +- .../pal/trackerapi/TimeEntryApiTest.java | 19 ++++ .../pal/trackerapi/WelcomeApiTest.java | 2 +- 11 files changed, 176 insertions(+), 12 deletions(-) create mode 100644 out/production/resources/application-cloud.yml create mode 100644 out/production/resources/application-test.yml create mode 100644 out/production/resources/application.yml create mode 100644 src/main/java/io/pivotal/pal/tracker/JdbcTimeEntryRepository.java diff --git a/build.gradle b/build.gradle index 0e9e340d6..3e313d12e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,10 @@ +import org.flywaydb.gradle.task.FlywayMigrateTask + plugins { id 'org.springframework.boot' version '2.1.6.RELEASE' id 'java' id 'idea' + id 'org.flywaydb.flyway' version '4.2.0' } apply plugin: 'io.spring.dependency-management' @@ -16,6 +19,10 @@ repositories { dependencies { compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.1") + + compile("org.springframework.boot:spring-boot-starter-jdbc") + compile("mysql:mysql-connector-java:6.0.6") + compile('org.springframework.boot:spring-boot-starter-web') //the below are the dependencies contained in 'spring-boot-starter-web' /* compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.0.pr1' @@ -30,11 +37,24 @@ dependencies { } +def developmentDbUrl = "jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false" +flyway { + url = developmentDbUrl + user = "tracker" + password = "" + locations = ["filesystem:databases/tracker/migrations"] +} + +def testDbUrl = "jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false" +task testMigrate(type: FlywayMigrateTask) { + url = testDbUrl +} + //can use instead of yaml -//bootRun.environment([ -// "WELCOME_MESSAGE": "hello", -//]) +bootRun.environment([ + "SPRING_DATASOURCE_URL": "jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false", +]) // -//test.environment([ -// "WELCOME_MESSAGE": "Hello from test", -//]) \ No newline at end of file +test.environment([ + "SPRING_DATASOURCE_URL": "jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false", +]) \ No newline at end of file diff --git a/out/production/resources/application-cloud.yml b/out/production/resources/application-cloud.yml new file mode 100644 index 000000000..6222c68cf --- /dev/null +++ b/out/production/resources/application-cloud.yml @@ -0,0 +1,5 @@ +--- +spring: + application: + name: pal-tracker +welcome_message: "hello from cloud foundry/yaml!" \ No newline at end of file diff --git a/out/production/resources/application-test.yml b/out/production/resources/application-test.yml new file mode 100644 index 000000000..9c2427b8a --- /dev/null +++ b/out/production/resources/application-test.yml @@ -0,0 +1,8 @@ +--- +spring: + application: + name: pal-tracker + datasource: + url: jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false + +welcome_message: Hello from test \ No newline at end of file diff --git a/out/production/resources/application.yml b/out/production/resources/application.yml new file mode 100644 index 000000000..f2593f370 --- /dev/null +++ b/out/production/resources/application.yml @@ -0,0 +1,8 @@ +--- +spring: + application: + name: pal-tracker + datasource: + url: jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false + +welcome_message: hello from yaml! diff --git a/src/main/java/io/pivotal/pal/tracker/JdbcTimeEntryRepository.java b/src/main/java/io/pivotal/pal/tracker/JdbcTimeEntryRepository.java new file mode 100644 index 000000000..6c2750368 --- /dev/null +++ b/src/main/java/io/pivotal/pal/tracker/JdbcTimeEntryRepository.java @@ -0,0 +1,88 @@ +package io.pivotal.pal.tracker; + +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.ResultSetExtractor; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.jdbc.support.GeneratedKeyHolder; +import org.springframework.jdbc.support.KeyHolder; + +import javax.sql.DataSource; +import java.sql.Date; +import java.sql.PreparedStatement; +import java.util.List; + +import static java.sql.Statement.RETURN_GENERATED_KEYS; + +public class JdbcTimeEntryRepository implements TimeEntryRepository { + + private JdbcTemplate jdbcTemplate; + + public JdbcTimeEntryRepository(DataSource dataSource) { + this.jdbcTemplate = new JdbcTemplate(dataSource); + } + + @Override + public TimeEntry create(TimeEntry timeEntry) { + KeyHolder generatedKeyHolder = new GeneratedKeyHolder(); + + jdbcTemplate.update(connection -> { + PreparedStatement statement = connection.prepareStatement( + "INSERT INTO time_entries (project_id, user_id, date, hours) " + + "VALUES (?, ?, ?, ?)", + RETURN_GENERATED_KEYS + ); + + statement.setLong(1, timeEntry.getProjectId()); + statement.setLong(2, timeEntry.getUserId()); + statement.setDate(3, Date.valueOf(timeEntry.getDate())); + statement.setInt(4, timeEntry.getHours()); + + return statement; + }, generatedKeyHolder); + + return find(generatedKeyHolder.getKey().longValue()); + } + + @Override + public TimeEntry find(Long id) { + return jdbcTemplate.query( + "SELECT id, project_id, user_id, date, hours FROM time_entries WHERE id = ?", + new Object[]{id}, + extractor); + } + + @Override + public List list() { + return jdbcTemplate.query("SELECT id, project_id, user_id, date, hours FROM time_entries", mapper); + } + + @Override + public TimeEntry update(Long id, TimeEntry timeEntry) { + jdbcTemplate.update("UPDATE time_entries " + + "SET project_id = ?, user_id = ?, date = ?, hours = ? " + + "WHERE id = ?", + timeEntry.getProjectId(), + timeEntry.getUserId(), + Date.valueOf(timeEntry.getDate()), + timeEntry.getHours(), + id); + + return find(id); + } + + @Override + public void delete(Long id) { + jdbcTemplate.update("DELETE FROM time_entries WHERE id = ?", id); + } + + private final RowMapper mapper = (rs, rowNum) -> new TimeEntry( + rs.getLong("id"), + rs.getLong("project_id"), + rs.getLong("user_id"), + rs.getDate("date").toLocalDate(), + rs.getInt("hours") + ); + + private final ResultSetExtractor extractor = + (rs) -> rs.next() ? mapper.mapRow(rs, 1) : null; +} diff --git a/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java b/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java index 6ac82026b..be60112dc 100644 --- a/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java +++ b/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java @@ -4,6 +4,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.mysql.cj.jdbc.MysqlDataSource; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @@ -13,8 +15,10 @@ public class PalTrackerApplication { @Bean - TimeEntryRepository timeEntryRepository() { - return new InMemoryTimeEntryRepository(); + TimeEntryRepository timeEntryRepository(@Value("${spring.datasource.url}") String datasourceUrl) { + MysqlDataSource dataSource = new MysqlDataSource(); + dataSource.setURL(datasourceUrl); + return new JdbcTimeEntryRepository(dataSource); } @Bean diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index fbd0221ae..9c2427b8a 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -1,2 +1,8 @@ --- -welcome_message: "Hello from test" \ No newline at end of file +spring: + application: + name: pal-tracker + datasource: + url: jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false + +welcome_message: Hello from test \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b980d66b4..f2593f370 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,4 +2,7 @@ spring: application: name: pal-tracker -welcome_message: "hello from yaml!" \ No newline at end of file + datasource: + url: jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false + +welcome_message: hello from yaml! diff --git a/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java b/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java index e1eac20fc..64aaecb44 100644 --- a/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java +++ b/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java @@ -7,6 +7,7 @@ import io.pivotal.pal.tracker.TimeEntryRepository; import org.junit.Before; import org.junit.Test; +import org.springframework.beans.factory.annotation.Value; import org.springframework.jdbc.core.JdbcTemplate; import java.sql.Date; @@ -20,11 +21,13 @@ public class JdbcTimeEntryRepositoryTest { private TimeEntryRepository subject; private JdbcTemplate jdbcTemplate; + @Value("${spring.datasource.url}") + private String datasourceUrl; @Before public void setUp() throws Exception { MysqlDataSource dataSource = new MysqlDataSource(); - dataSource.setUrl(System.getenv("SPRING_DATASOURCE_URL")); + dataSource.setUrl(System.getenv(datasourceUrl)); subject = new JdbcTimeEntryRepository(dataSource); diff --git a/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java index 69c2c0b65..ebbf74ca0 100644 --- a/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java +++ b/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java @@ -1,21 +1,26 @@ package test.pivotal.pal.trackerapi; import com.jayway.jsonpath.DocumentContext; +import com.mysql.cj.jdbc.MysqlDataSource; import io.pivotal.pal.tracker.PalTrackerApplication; import io.pivotal.pal.tracker.TimeEntry; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.junit4.SpringRunner; import java.time.LocalDate; import java.util.Collection; +import java.util.TimeZone; import static com.jayway.jsonpath.JsonPath.parse; import static org.assertj.core.api.Assertions.assertThat; @@ -28,10 +33,24 @@ public class TimeEntryApiTest { @Autowired private TestRestTemplate restTemplate; + @Value("${spring.datasource.url}") + private String datasourceUrl; + private final long projectId = 123L; private final long userId = 456L; private TimeEntry timeEntry = new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8); + @Before + public void setUp() throws Exception { + MysqlDataSource dataSource = new MysqlDataSource(); + dataSource.setUrl(System.getenv(datasourceUrl)); + + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); + jdbcTemplate.execute("TRUNCATE time_entries"); + + TimeZone.setDefault(TimeZone.getTimeZone("UTC")); + } + @Test public void testCreate() throws Exception { ResponseEntity createResponse = restTemplate.postForEntity("/time-entries", timeEntry, String.class); diff --git a/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java index a87e52c78..b286607c1 100644 --- a/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java +++ b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java @@ -14,7 +14,7 @@ @RunWith(SpringRunner.class) @SpringBootTest(classes = PalTrackerApplication.class, webEnvironment = RANDOM_PORT) -//@Ignore("test can only be run when setting SPRING_PROFILES_ACTIVE=test") +@Ignore("test can only be run when setting SPRING_PROFILES_ACTIVE=test") //set via the following commands from terminal: export SPRING_PROFILES_ACTIVE=test && ./gradlew clean build public class WelcomeApiTest { From c2fba3b0a3739f472760a0b11c1e5d24b655cdcf Mon Sep 17 00:00:00 2001 From: sashinpivotal Date: Tue, 20 Nov 2018 16:38:20 -0500 Subject: [PATCH 13/14] Add tests for Actuator lab --- .../pivotal/pal/trackerapi/HealthApiTest.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/test/java/test/pivotal/pal/trackerapi/HealthApiTest.java diff --git a/src/test/java/test/pivotal/pal/trackerapi/HealthApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/HealthApiTest.java new file mode 100644 index 000000000..f19529c4a --- /dev/null +++ b/src/test/java/test/pivotal/pal/trackerapi/HealthApiTest.java @@ -0,0 +1,50 @@ +package test.pivotal.pal.trackerapi; + +import com.jayway.jsonpath.DocumentContext; +import io.pivotal.pal.tracker.PalTrackerApplication; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.junit4.SpringRunner; + +import static com.jayway.jsonpath.JsonPath.parse; +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = PalTrackerApplication.class, webEnvironment = RANDOM_PORT) +public class HealthApiTest { + + @LocalServerPort + private String port; + private TestRestTemplate restTemplate; + + @Before + public void setUp() throws Exception { + RestTemplateBuilder builder = new RestTemplateBuilder() + .rootUri("http://localhost:" + port) + .basicAuthorization("user", "password"); + + restTemplate = new TestRestTemplate(builder); + } + + @Test + public void healthTest() { + ResponseEntity response = this.restTemplate.getForEntity("/actuator/health", String.class); + + + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); + + DocumentContext healthJson = parse(response.getBody()); + + assertThat(healthJson.read("$.status", String.class)).isEqualTo("UP"); + assertThat(healthJson.read("$.details.db.status", String.class)).isEqualTo("UP"); + assertThat(healthJson.read("$.details.diskSpace.status", String.class)).isEqualTo("UP"); + } +} From 75593ab537d213fc9d750cd7e603fbbc93f1bb24 Mon Sep 17 00:00:00 2001 From: Tito Yslas Date: Wed, 31 Jul 2019 16:56:43 -0600 Subject: [PATCH 14/14] deployed with actuator working --- .gitignore | 1 + build.gradle | 58 ++++++++++++++----- .../resources/application-cloud.yml | 5 ++ out/production/resources/application-test.yml | 3 + out/production/resources/application.yml | 3 + pal-tracker.yml | 6 +- .../pal/tracker/JdbcTimeEntryRepository.java | 2 +- .../pal/tracker/PalTrackerApplication.java | 19 +++--- .../pal/tracker/TimeEntryController.java | 26 +++++++-- .../pal/tracker/TimeEntryHealthIndicator.java | 29 ++++++++++ src/main/resources/application-cloud.yml | 5 ++ src/main/resources/application-test.yml | 6 +- src/main/resources/application.yml | 10 +++- .../tracker/JdbcTimeEntryRepositoryTest.java | 5 +- .../pal/tracker/TimeEntryControllerTest.java | 15 ++++- .../pivotal/pal/trackerapi/HealthApiTest.java | 2 + .../pal/trackerapi/TimeEntryApiTest.java | 5 +- .../pal/trackerapi/WelcomeApiTest.java | 2 +- 18 files changed, 156 insertions(+), 46 deletions(-) create mode 100644 src/main/java/io/pivotal/pal/tracker/TimeEntryHealthIndicator.java diff --git a/.gitignore b/.gitignore index 4fa332f5c..79e7bcfc1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build .idea *.iml ci/variables.yml +out diff --git a/build.gradle b/build.gradle index 3e313d12e..cae937c2a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,24 @@ import org.flywaydb.gradle.task.FlywayMigrateTask +buildscript { + ext { + springBootVersion = "2.0.6.RELEASE" + } + + repositories { + mavenCentral() + } + + dependencies { + classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion" + } +} + plugins { id 'org.springframework.boot' version '2.1.6.RELEASE' id 'java' id 'idea' - id 'org.flywaydb.flyway' version '4.2.0' + id "org.flywaydb.flyway" version "5.0.5" } apply plugin: 'io.spring.dependency-management' @@ -13,17 +27,22 @@ group = 'io.pivotal.pal.tracker' version = '0.0.1-SNAPSHOT' sourceCompatibility = '1.8' +springBoot { + buildInfo() +} + repositories { mavenCentral() } dependencies { - compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.1") + compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") + compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.7") + compile("org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion") - compile("org.springframework.boot:spring-boot-starter-jdbc") - compile("mysql:mysql-connector-java:6.0.6") + compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.17' + compile("org.springframework.boot:spring-boot-starter-actuator:$springBootVersion") - compile('org.springframework.boot:spring-boot-starter-web') //the below are the dependencies contained in 'spring-boot-starter-web' /* compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.0.pr1' compile group: 'org.hibernate.validator', name: 'hibernate-validator', version: '6.0.17.Final' @@ -38,6 +57,23 @@ dependencies { } def developmentDbUrl = "jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false" +bootRun.environment([ + "WELCOME_MESSAGE": "hello", + "SPRING_DATASOURCE_URL": developmentDbUrl, + "MANAGEMENT_SECURITY_ENABLED": false, + "MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE": "*", + "MANAGEMENT_ENDPOINT_HEALTH_SHOWDETAILS": "always", +]) + +def testDbUrl = "jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false" +test.environment([ + "WELCOME_MESSAGE": "Hello from test", + "SPRING_DATASOURCE_URL": testDbUrl, + "MANAGEMENT_SECURITY_ENABLED": false, + "MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE": "*", + "MANAGEMENT_ENDPOINT_HEALTH_SHOWDETAILS": "always", +]) + flyway { url = developmentDbUrl user = "tracker" @@ -45,16 +81,6 @@ flyway { locations = ["filesystem:databases/tracker/migrations"] } -def testDbUrl = "jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false" task testMigrate(type: FlywayMigrateTask) { url = testDbUrl -} - -//can use instead of yaml -bootRun.environment([ - "SPRING_DATASOURCE_URL": "jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false", -]) -// -test.environment([ - "SPRING_DATASOURCE_URL": "jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false", -]) \ No newline at end of file +} \ No newline at end of file diff --git a/out/production/resources/application-cloud.yml b/out/production/resources/application-cloud.yml index 6222c68cf..45e6aa738 100644 --- a/out/production/resources/application-cloud.yml +++ b/out/production/resources/application-cloud.yml @@ -2,4 +2,9 @@ spring: application: name: pal-tracker +management: + endpoints: + web: + exposure: + include: * welcome_message: "hello from cloud foundry/yaml!" \ No newline at end of file diff --git a/out/production/resources/application-test.yml b/out/production/resources/application-test.yml index 9c2427b8a..309eb8d16 100644 --- a/out/production/resources/application-test.yml +++ b/out/production/resources/application-test.yml @@ -4,5 +4,8 @@ spring: name: pal-tracker datasource: url: jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false + management: + security: + enabled: false welcome_message: Hello from test \ No newline at end of file diff --git a/out/production/resources/application.yml b/out/production/resources/application.yml index f2593f370..8b8691140 100644 --- a/out/production/resources/application.yml +++ b/out/production/resources/application.yml @@ -4,5 +4,8 @@ spring: name: pal-tracker datasource: url: jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false + management: + security: + enabled: false welcome_message: hello from yaml! diff --git a/pal-tracker.yml b/pal-tracker.yml index c8cd57d12..01d7e79b6 100644 --- a/pal-tracker.yml +++ b/pal-tracker.yml @@ -1,7 +1,9 @@ --- applications: - - name: pal-tracker-tito + - name: pal-tracker-tito-dev path: ./build/libs/pal-tracker-0.0.1-SNAPSHOT.jar buildpacks: - java_buildpack - memory: 1G \ No newline at end of file + memory: 1G + services: + - mysql-db diff --git a/src/main/java/io/pivotal/pal/tracker/JdbcTimeEntryRepository.java b/src/main/java/io/pivotal/pal/tracker/JdbcTimeEntryRepository.java index 6c2750368..2cbb2e36d 100644 --- a/src/main/java/io/pivotal/pal/tracker/JdbcTimeEntryRepository.java +++ b/src/main/java/io/pivotal/pal/tracker/JdbcTimeEntryRepository.java @@ -15,7 +15,7 @@ public class JdbcTimeEntryRepository implements TimeEntryRepository { - private JdbcTemplate jdbcTemplate; + private final JdbcTemplate jdbcTemplate; public JdbcTimeEntryRepository(DataSource dataSource) { this.jdbcTemplate = new JdbcTemplate(dataSource); diff --git a/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java b/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java index be60112dc..5ba87871e 100644 --- a/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java +++ b/src/main/java/io/pivotal/pal/tracker/PalTrackerApplication.java @@ -4,20 +4,25 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.mysql.cj.jdbc.MysqlDataSource; -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.http.converter.json.Jackson2ObjectMapperBuilder; +import javax.sql.DataSource; +import java.util.TimeZone; + @SpringBootApplication public class PalTrackerApplication { + public static void main(String[] args) { + // Make sure the application runs as UTC + TimeZone.setDefault(TimeZone.getTimeZone("UTC")); + SpringApplication.run(PalTrackerApplication.class, args); + } + @Bean - TimeEntryRepository timeEntryRepository(@Value("${spring.datasource.url}") String datasourceUrl) { - MysqlDataSource dataSource = new MysqlDataSource(); - dataSource.setURL(datasourceUrl); + TimeEntryRepository timeEntryRepository(DataSource dataSource) { return new JdbcTimeEntryRepository(dataSource); } @@ -29,8 +34,4 @@ public ObjectMapper jsonObjectMapper() { .modules(new JavaTimeModule()) .build(); } - - public static void main(String[] args) { - SpringApplication.run(PalTrackerApplication.class, args); - } } diff --git a/src/main/java/io/pivotal/pal/tracker/TimeEntryController.java b/src/main/java/io/pivotal/pal/tracker/TimeEntryController.java index 25c43a65a..155ec16ec 100644 --- a/src/main/java/io/pivotal/pal/tracker/TimeEntryController.java +++ b/src/main/java/io/pivotal/pal/tracker/TimeEntryController.java @@ -1,5 +1,8 @@ package io.pivotal.pal.tracker; +import io.micrometer.core.instrument.Counter; +import io.micrometer.core.instrument.DistributionSummary; +import io.micrometer.core.instrument.MeterRegistry; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -10,15 +13,21 @@ @RequestMapping("/time-entries") public class TimeEntryController { + private final DistributionSummary timeEntrySummary; + private final Counter actionCounter; private TimeEntryRepository timeEntriesRepo; - public TimeEntryController(TimeEntryRepository timeEntriesRepo) { + public TimeEntryController(TimeEntryRepository timeEntriesRepo, MeterRegistry meterRegistry) { this.timeEntriesRepo = timeEntriesRepo; + timeEntrySummary = meterRegistry.summary("timeEntry.summary"); + actionCounter = meterRegistry.counter("timeEntry.actionCounter"); } @PostMapping public ResponseEntity create(@RequestBody TimeEntry timeEntry) { TimeEntry createdTimeEntry = timeEntriesRepo.create(timeEntry); + actionCounter.increment(); + timeEntrySummary.record(timeEntriesRepo.list().size()); return new ResponseEntity<>(createdTimeEntry, HttpStatus.CREATED); } @@ -26,12 +35,17 @@ public ResponseEntity create(@RequestBody TimeEntry timeEntry) { @GetMapping("{id}") public ResponseEntity read(@PathVariable Long id) { TimeEntry timeEntry = timeEntriesRepo.find(id); - if (timeEntry != null) return new ResponseEntity<>(timeEntry, HttpStatus.OK); - else return new ResponseEntity<>(HttpStatus.NOT_FOUND); + if (timeEntry != null) { + actionCounter.increment(); + return new ResponseEntity<>(timeEntry, HttpStatus.OK); + } else { + return new ResponseEntity<>(HttpStatus.NOT_FOUND); + } } @GetMapping public ResponseEntity> list() { + actionCounter.increment(); return new ResponseEntity<>(timeEntriesRepo.list(), HttpStatus.OK); } @@ -39,6 +53,7 @@ public ResponseEntity> list() { public ResponseEntity update(@PathVariable Long id, @RequestBody TimeEntry expected) { TimeEntry updatedTimeEntry = timeEntriesRepo.update(id, expected); if (updatedTimeEntry != null) { + actionCounter.increment(); return new ResponseEntity<>(updatedTimeEntry, HttpStatus.OK); } else return new ResponseEntity<>(HttpStatus.NOT_FOUND); } @@ -47,6 +62,9 @@ public ResponseEntity update(@PathVariable Long id, @RequestBody Time public ResponseEntity delete(@PathVariable Long id) { TimeEntry timeEntry = timeEntriesRepo.find(id); timeEntriesRepo.delete(id); - return new ResponseEntity<>(timeEntry, HttpStatus.NO_CONTENT); + actionCounter.increment(); + timeEntrySummary.record(timeEntriesRepo.list().size()); + + return new ResponseEntity<>(HttpStatus.NO_CONTENT); } } diff --git a/src/main/java/io/pivotal/pal/tracker/TimeEntryHealthIndicator.java b/src/main/java/io/pivotal/pal/tracker/TimeEntryHealthIndicator.java new file mode 100644 index 000000000..e080a0e51 --- /dev/null +++ b/src/main/java/io/pivotal/pal/tracker/TimeEntryHealthIndicator.java @@ -0,0 +1,29 @@ +package io.pivotal.pal.tracker; + +import org.springframework.boot.actuate.health.Health; +import org.springframework.boot.actuate.health.HealthIndicator; +import org.springframework.stereotype.Component; + +@Component +public class TimeEntryHealthIndicator implements HealthIndicator { + + private static final int MAX_TIME_ENTRIES = 5; + private final TimeEntryRepository timeEntryRepo; + + public TimeEntryHealthIndicator(TimeEntryRepository timeEntryRepo) { + this.timeEntryRepo = timeEntryRepo; + } + + @Override + public Health health() { + Health.Builder builder = new Health.Builder(); + + if (timeEntryRepo.list().size() < MAX_TIME_ENTRIES) { + builder.up(); + } else { + builder.down(); + } + + return builder.build(); + } +} \ No newline at end of file diff --git a/src/main/resources/application-cloud.yml b/src/main/resources/application-cloud.yml index 6222c68cf..40016ae35 100644 --- a/src/main/resources/application-cloud.yml +++ b/src/main/resources/application-cloud.yml @@ -2,4 +2,9 @@ spring: application: name: pal-tracker +management: + endpoints: + web: + exposure: + include: "*" welcome_message: "hello from cloud foundry/yaml!" \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 9c2427b8a..abe9ab438 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -4,5 +4,9 @@ spring: name: pal-tracker datasource: url: jdbc:mysql://localhost:3306/tracker_test?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false - +management: + endpoints: + web: + exposure: + include: "*" welcome_message: Hello from test \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f2593f370..c30f97212 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,7 +2,11 @@ spring: application: name: pal-tracker - datasource: - url: jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false - +# datasource: +# url: jdbc:mysql://localhost:3306/tracker_dev?user=tracker&useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false +management: + endpoints: + web: + exposure: + include: "*" welcome_message: hello from yaml! diff --git a/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java b/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java index 64aaecb44..e1eac20fc 100644 --- a/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java +++ b/src/test/java/test/pivotal/pal/tracker/JdbcTimeEntryRepositoryTest.java @@ -7,7 +7,6 @@ import io.pivotal.pal.tracker.TimeEntryRepository; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.factory.annotation.Value; import org.springframework.jdbc.core.JdbcTemplate; import java.sql.Date; @@ -21,13 +20,11 @@ public class JdbcTimeEntryRepositoryTest { private TimeEntryRepository subject; private JdbcTemplate jdbcTemplate; - @Value("${spring.datasource.url}") - private String datasourceUrl; @Before public void setUp() throws Exception { MysqlDataSource dataSource = new MysqlDataSource(); - dataSource.setUrl(System.getenv(datasourceUrl)); + dataSource.setUrl(System.getenv("SPRING_DATASOURCE_URL")); subject = new JdbcTimeEntryRepository(dataSource); diff --git a/src/test/java/test/pivotal/pal/tracker/TimeEntryControllerTest.java b/src/test/java/test/pivotal/pal/tracker/TimeEntryControllerTest.java index 7af2f223b..8861b0407 100644 --- a/src/test/java/test/pivotal/pal/tracker/TimeEntryControllerTest.java +++ b/src/test/java/test/pivotal/pal/tracker/TimeEntryControllerTest.java @@ -1,5 +1,8 @@ package test.pivotal.pal.tracker; +import io.micrometer.core.instrument.Counter; +import io.micrometer.core.instrument.DistributionSummary; +import io.micrometer.core.instrument.MeterRegistry; import io.pivotal.pal.tracker.TimeEntry; import io.pivotal.pal.tracker.TimeEntryController; import io.pivotal.pal.tracker.TimeEntryRepository; @@ -24,7 +27,17 @@ public class TimeEntryControllerTest { @Before public void setUp() throws Exception { timeEntryRepository = mock(TimeEntryRepository.class); - controller = new TimeEntryController(timeEntryRepository); + MeterRegistry meterRegistry = mock(MeterRegistry.class); + + doReturn(mock(DistributionSummary.class)) + .when(meterRegistry) + .summary("timeEntry.summary"); + + doReturn(mock(Counter.class)) + .when(meterRegistry) + .counter("timeEntry.actionCounter"); + + controller = new TimeEntryController(timeEntryRepository, meterRegistry); } @Test diff --git a/src/test/java/test/pivotal/pal/trackerapi/HealthApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/HealthApiTest.java index f19529c4a..a92d951a5 100644 --- a/src/test/java/test/pivotal/pal/trackerapi/HealthApiTest.java +++ b/src/test/java/test/pivotal/pal/trackerapi/HealthApiTest.java @@ -3,6 +3,7 @@ import com.jayway.jsonpath.DocumentContext; import io.pivotal.pal.tracker.PalTrackerApplication; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; @@ -19,6 +20,7 @@ @RunWith(SpringRunner.class) @SpringBootTest(classes = PalTrackerApplication.class, webEnvironment = RANDOM_PORT) +//@Ignore public class HealthApiTest { @LocalServerPort diff --git a/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java index ebbf74ca0..b481109fa 100644 --- a/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java +++ b/src/test/java/test/pivotal/pal/trackerapi/TimeEntryApiTest.java @@ -33,9 +33,6 @@ public class TimeEntryApiTest { @Autowired private TestRestTemplate restTemplate; - @Value("${spring.datasource.url}") - private String datasourceUrl; - private final long projectId = 123L; private final long userId = 456L; private TimeEntry timeEntry = new TimeEntry(projectId, userId, LocalDate.parse("2017-01-08"), 8); @@ -43,7 +40,7 @@ public class TimeEntryApiTest { @Before public void setUp() throws Exception { MysqlDataSource dataSource = new MysqlDataSource(); - dataSource.setUrl(System.getenv(datasourceUrl)); + dataSource.setUrl(System.getenv("SPRING_DATASOURCE_URL")); JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); jdbcTemplate.execute("TRUNCATE time_entries"); diff --git a/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java index b286607c1..a87e52c78 100644 --- a/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java +++ b/src/test/java/test/pivotal/pal/trackerapi/WelcomeApiTest.java @@ -14,7 +14,7 @@ @RunWith(SpringRunner.class) @SpringBootTest(classes = PalTrackerApplication.class, webEnvironment = RANDOM_PORT) -@Ignore("test can only be run when setting SPRING_PROFILES_ACTIVE=test") +//@Ignore("test can only be run when setting SPRING_PROFILES_ACTIVE=test") //set via the following commands from terminal: export SPRING_PROFILES_ACTIVE=test && ./gradlew clean build public class WelcomeApiTest {