From 4c97776e9e508170a4813cd8477038748fcb45c5 Mon Sep 17 00:00:00 2001 From: eder13 Date: Wed, 27 May 2020 08:39:56 +0200 Subject: [PATCH 1/5] resolved merging conflicts for pulling --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b8c906c..7e34712 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ jackson-core - + com.fasterxml.jackson.core jackson-databind From ee73ca4d6748619ac020b8947951fd7e93a790f9 Mon Sep 17 00:00:00 2001 From: eder13 Date: Wed, 27 May 2020 09:24:20 +0200 Subject: [PATCH 2/5] update develop branch with upstream --- .../vocabularytrainer/project/controller/Beans.java | 3 ++- src/main/resources/application.properties | 6 +++--- .../user/csv-output/export_vocabularies_user.csv | 10 +++++----- src/main/resources/templates/user/import_vocab.html | 3 ++- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/vocabularytrainer/project/controller/Beans.java b/src/main/java/com/vocabularytrainer/project/controller/Beans.java index a4f879a..904033e 100644 --- a/src/main/java/com/vocabularytrainer/project/controller/Beans.java +++ b/src/main/java/com/vocabularytrainer/project/controller/Beans.java @@ -13,6 +13,7 @@ @Configuration public class Beans implements WebMvcConfigurer{ + @Bean public LocaleResolver localeResolver() { SessionLocaleResolver slr = new SessionLocaleResolver(); @@ -23,7 +24,7 @@ public LocaleResolver localeResolver() { @Bean public LocaleChangeInterceptor localeChangeInterceptor() { LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); - lci.setParamName("lang"); + lci.setParamName("lang"); // change interface language return lci; } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b4e0ac6..640172a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,4 +1,4 @@ spring.jpa.hibernate.ddl-auto=update -spring.datasource.url=jdbc:mysql://127.0.0.1:3306/db_vocabularytrainer?useLegacyDatetimeCode=false&serverTimezone=CET -spring.datasource.username=root -spring.datasource.password=e2e4sc3.tu \ No newline at end of file +spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/db_vocabularytrainer?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false +spring.datasource.username=student +spring.datasource.password=student \ No newline at end of file diff --git a/src/main/resources/templates/user/csv-output/export_vocabularies_user.csv b/src/main/resources/templates/user/csv-output/export_vocabularies_user.csv index 041229b..95bfc83 100644 --- a/src/main/resources/templates/user/csv-output/export_vocabularies_user.csv +++ b/src/main/resources/templates/user/csv-output/export_vocabularies_user.csv @@ -1,6 +1,6 @@ id;user;german_word;engl_trans;rating;tag -1;user;Käse;cheese;0;Noun -2;user;gelb;yellow;0; -3;user;Huhn;chicken;0; -6;user;Speck;ham;0; -7;user;Fahrrad;bicycle;0; +3;user;Mittwoch;Wednesday;0; +4;user;Sprache;language;0; +5;user;heute;today;0; +6;user;Katze;cat;0; +11;user;Jacke;jacket;0; diff --git a/src/main/resources/templates/user/import_vocab.html b/src/main/resources/templates/user/import_vocab.html index ef3d0b0..277afa7 100644 --- a/src/main/resources/templates/user/import_vocab.html +++ b/src/main/resources/templates/user/import_vocab.html @@ -62,7 +62,8 @@ -

Import Vocabulaies

+
+

Import Vocabularies

From b22e509aa6a493477253bfc61240cccf03fd8260 Mon Sep 17 00:00:00 2001 From: eder13 Date: Wed, 27 May 2020 11:33:47 +0200 Subject: [PATCH 3/5] LANG_018 started reading docs unit tests [FS, RS] --- .../controller/{Beans.java => InterfaceLangConfig.java} | 2 +- .../vocabularytrainer/project/controller/MVCController.java | 3 ++- .../project/VocabularyTrainerConfigTests.java | 1 + .../project/controller/MVCControllerTest.java | 6 ++---- 4 files changed, 6 insertions(+), 6 deletions(-) rename src/main/java/com/vocabularytrainer/project/controller/{Beans.java => InterfaceLangConfig.java} (95%) diff --git a/src/main/java/com/vocabularytrainer/project/controller/Beans.java b/src/main/java/com/vocabularytrainer/project/controller/InterfaceLangConfig.java similarity index 95% rename from src/main/java/com/vocabularytrainer/project/controller/Beans.java rename to src/main/java/com/vocabularytrainer/project/controller/InterfaceLangConfig.java index 904033e..1feda22 100644 --- a/src/main/java/com/vocabularytrainer/project/controller/Beans.java +++ b/src/main/java/com/vocabularytrainer/project/controller/InterfaceLangConfig.java @@ -12,7 +12,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration -public class Beans implements WebMvcConfigurer{ +public class InterfaceLangConfig implements WebMvcConfigurer{ @Bean public LocaleResolver localeResolver() { diff --git a/src/main/java/com/vocabularytrainer/project/controller/MVCController.java b/src/main/java/com/vocabularytrainer/project/controller/MVCController.java index 6d2c3a8..63a9ffc 100644 --- a/src/main/java/com/vocabularytrainer/project/controller/MVCController.java +++ b/src/main/java/com/vocabularytrainer/project/controller/MVCController.java @@ -313,7 +313,7 @@ public String getEnglishStartPage() { public String getFrenchStartPage() { return "?lang=fr"; } - +/* @GetMapping("/user/?lang=de") public String getGermanPage() { return "user/?lang=de"; @@ -326,6 +326,7 @@ public String getEnglishPage() { public String getFrenchPage() { return "user/?lang=fr"; } +*/ //Testing Mode @GetMapping("/user/test") diff --git a/src/test/java/com/vocabularytrainer/project/VocabularyTrainerConfigTests.java b/src/test/java/com/vocabularytrainer/project/VocabularyTrainerConfigTests.java index a64a8eb..62c898f 100644 --- a/src/test/java/com/vocabularytrainer/project/VocabularyTrainerConfigTests.java +++ b/src/test/java/com/vocabularytrainer/project/VocabularyTrainerConfigTests.java @@ -22,6 +22,7 @@ public class VocabularyTrainerConfigTests { // Eine Autowired-Annotationen bewirkt eine automatische Verdrahtung - wie der Name bereits verrät. // D. h. Diese Methode wird ausgelöst, wenn eine Instanz von der Klasse erzeugt wird, in der sie // enthalten ist. + @Autowired private MVCController controller; diff --git a/src/test/java/com/vocabularytrainer/project/controller/MVCControllerTest.java b/src/test/java/com/vocabularytrainer/project/controller/MVCControllerTest.java index 97e39ee..22a06d1 100644 --- a/src/test/java/com/vocabularytrainer/project/controller/MVCControllerTest.java +++ b/src/test/java/com/vocabularytrainer/project/controller/MVCControllerTest.java @@ -1,6 +1,5 @@ package com.vocabularytrainer.project.controller; - import com.vocabularytrainer.project.db.VocabularyEntries; import com.vocabularytrainer.project.db.VocabularyRepository; import org.junit.jupiter.api.AfterEach; @@ -27,7 +26,6 @@ @SpringBootTest public class MVCControllerTest { - @Autowired private MVCController controller; @@ -54,8 +52,8 @@ public class MVCControllerTest { @BeforeEach public void beforeEach() { // Initialisiere Mocks - MockitoAnnotations.initMocks(this); - + MockitoAnnotations.initMocks(this); // SpringBootTest --> this class + // Import Package // Hier legen wir ein Return-Verhalten für unterschiedliche Methoden fest. // z. B. Wenn "getAuthentiication()" aufgerufen wird, gibt die From 1d3f5aa00163353155201048f6e7fc356b54c9ba Mon Sep 17 00:00:00 2001 From: eder13 Date: Wed, 27 May 2020 12:44:26 +0200 Subject: [PATCH 4/5] LANG_018 started reading docs unit tests [FS, RS] --- .../vocabularytrainer/project/controller/MVCController.java | 6 ++++-- src/main/resources/templates/user/index.html | 4 ++++ .../resources/templates/user/study_interface_english.html | 2 ++ .../resources/templates/user/study_interface_german.html | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/vocabularytrainer/project/controller/MVCController.java b/src/main/java/com/vocabularytrainer/project/controller/MVCController.java index 63a9ffc..e4822e9 100644 --- a/src/main/java/com/vocabularytrainer/project/controller/MVCController.java +++ b/src/main/java/com/vocabularytrainer/project/controller/MVCController.java @@ -448,7 +448,6 @@ public String userTestRepetition(Model model) { return "user/test/testingmode_repetition"; } - /* Export and Download vocabularies as CSV */ @GetMapping("user/export_vocabularies") public ResponseEntity export() @@ -522,11 +521,14 @@ public ResponseEntity export() /* Importing CSV */ /// TODO: GetMapping for import_vocab.html - @GetMapping("user/import") + //@GetMapping("user/import") + /* public String showImportView() { return "user/import_vocab"; } + */ /// TODO: PostMapping for import_vocab.html - the Read-Process (import CSV to Database) + } \ No newline at end of file diff --git a/src/main/resources/templates/user/index.html b/src/main/resources/templates/user/index.html index 7144e0b..024fe3f 100644 --- a/src/main/resources/templates/user/index.html +++ b/src/main/resources/templates/user/index.html @@ -95,9 +95,13 @@ + + + diff --git a/src/main/resources/templates/user/study_interface_english.html b/src/main/resources/templates/user/study_interface_english.html index 4174c73..1fab104 100644 --- a/src/main/resources/templates/user/study_interface_english.html +++ b/src/main/resources/templates/user/study_interface_english.html @@ -66,9 +66,11 @@ + diff --git a/src/main/resources/templates/user/study_interface_german.html b/src/main/resources/templates/user/study_interface_german.html index 7b341c4..ca1390f 100644 --- a/src/main/resources/templates/user/study_interface_german.html +++ b/src/main/resources/templates/user/study_interface_german.html @@ -65,9 +65,11 @@ + From e5402a90f5d0093a54e2070e194a837f3625cde9 Mon Sep 17 00:00:00 2001 From: eder13 Date: Wed, 3 Jun 2020 10:26:57 +0200 Subject: [PATCH 5/5] LANG_018 implemented unit testing csv [HA, RS] --- pom.xml | 6 ++ .../project/controller/MVCController.java | 28 +++++++- .../project/db/VocabularyRepository.java | 16 +++++ .../export_vocabularies_TestUser.csv | 1 + .../csv-output/export_vocabularies_user.csv | 1 + .../project/CSVWriterTests.java | 72 +++++++++++++++++++ .../VocabularyTrainerApplicationTests.java | 2 + .../project/VocabularyTrainerConfigTests.java | 8 +-- .../MVCControllerNoSecurityTest.java | 3 + .../project/controller/MVCControllerTest.java | 23 ++++-- 10 files changed, 147 insertions(+), 13 deletions(-) create mode 100644 src/main/resources/templates/user/csv-output/export_vocabularies_TestUser.csv create mode 100644 src/test/java/com/vocabularytrainer/project/CSVWriterTests.java diff --git a/pom.xml b/pom.xml index e718af8..b3ad65b 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,12 @@ --> + + org.junit.jupiter + junit-jupiter-engine + 5.4.2 + +